[R] read attribute

Omar Lakkis abu3ammar at gmail.com
Mon Dec 13 21:10:08 CET 2004


How can I get a single attribute value of an object ?

I jhave the tiemSeries object
> ts1
                    Open
2003-10-09 02:00:00 1.27
2003-10-10 02:00:00 1.25
2003-10-13 02:00:00 1.27
2003-10-14 02:00:00 1.29

When I unclass ts1 I get:
> unclass(ts1)
list()
attr(,"Data")
                    Open
2003-10-09 02:00:00 1.27
2003-10-10 02:00:00 1.25
2003-10-13 02:00:00 1.27
2003-10-14 02:00:00 1.29
attr(,"positions")
[1] "2003-10-09 02:00:00" "2003-10-10 02:00:00" "2003-10-13 02:00:00"
[4] "2003-10-14 02:00:00"
attr(,"format")
[1] "%Y-%m-%d %H:%M:%S"
attr(,"FinCenter")
[1] "Zurich"
attr(,"units")
[1] "Open"
attr(,"title")
[1] "Time Series Object"
attr(,"documentation")
[1] "Created at Zurich 2004-12-13 15:13:05"

How can I get teh value of the attribute positions?




More information about the R-help mailing list