[R] Odd behaviour of as.POSIXct

B77S bps0002 at auburn.edu
Fri Jul 15 19:04:25 CEST 2011


day doesn't exist?
That would be the 1st problem.



Johannes Egner wrote:
> 
> Dear all,
> 
> how come the first loop in the below fails, but the second performs as
> expected?
> 
> days <- as.Date( c("2000-01-01", "2000-01-02") )
> 
> for(day in days)
> {
>     as.POSIXct(day)
> }
> 
> for( n in 1:length(days) )
> {
>     show(as.POSIXct(days[n]))
> }
> 
> Many thanks, Jo
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 

--
View this message in context: http://r.789695.n4.nabble.com/Odd-behaviour-of-as-POSIXct-tp3670414p3670454.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list