Re: [R] POSIXlt and trunc

2012-06-15 Thread R. Michael Weylandt
General rule of thumb: use POSIXct rather than POSIXlt for such things and only convert to POSIXlt (losslessly) at the end of your calculations when you need it for display reasons. Internally, POSIXct is just a double, so it is nice to do calculations on, while POSIXlt is a list-like object which

Re: [R] POSIXlt and trunc

2012-06-15 Thread Rui Barradas
Hello, It works with me. Problem with R version? OS? sessionInfo() R version 2.15.0 (2012-03-30) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252 [3] LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C [5] LC_TIME=Portug

[R] POSIXlt and trunc

2012-06-14 Thread James Long
Hi, I'm having trouble understanding how trunc is operating on vectors of POSIXlt objects. Why does dates[1:4] in the last line return a bunch of NAs even though dates look like it has all the right elements? This worries me that something is off with my use of trunc. Is trunc not suppose to be ve