[R] read attribute

Mulholland, Tom Tom.Mulholland at dpi.wa.gov.au
Tue Dec 14 02:28:33 CET 2004


Since I'm not sure what you are trying to achieve would ts1 at positions get what you wanted without unclassing the object. I only ask this because my first instinct when I started using the Rmetrics package was to try and use ts1$positions which only gives you a null value.

Tom

> -----Original Message-----
> From: Omar Lakkis [mailto:abu3ammar at gmail.com]
> Sent: Tuesday, 14 December 2004 4:10 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] read attribute
> 
> 
> 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?
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list