Re: [R] as.vector with mode="list" and POSIXct

2013-05-22 Thread Alexandre Sieira
That's a very interesting point, David. The part I actually didn't know is that the class of an object is an attribute, and that by "removing all attributes" the function would in effect unclass it. Thank you. --  Alexandre Sieira CISA, CISSP, ISO 27001 Lead Auditor "

Re: [R] as.vector with mode="list" and POSIXct

2013-05-22 Thread Alexandre Sieira
ain for your interest and advice. --  Alexandre Sieira CISA, CISSP, ISO 27001 Lead Auditor "The truth is rarely pure and never simple." Oscar Wilde, The Importance of Being Earnest, 1895, Act I On 22 de maio de 2013 at 15:59:46, Jeff Newmiller (jdnew...@dcn.davis.ca.us) wrote: M

Re: [R] as.vector with mode="list" and POSIXct

2013-05-22 Thread Alexandre Sieira
now to treat POSIXct values differently. All of a sudden, the POSIXct objects I inserted are being treated, for example, by format as numeric instead of being dispatched to format.Date as expected. So I don't think my reaction to this issue was illogical at all. Hope you'll agree now t

Re: [R] as.vector with mode="list" and POSIXct

2013-05-21 Thread Alexandre Sieira
POSIXct[1:1], format: "2013-05-21 09:54:11" However, the next thing I need to do is a min() over that list, so I need to convert the list into a vector again. I agree completely with you that this is horrible for performance, but it is a temporary workaround until values() is "fix

Re: [R] as.vector with mode="list" and POSIXct

2013-05-20 Thread Alexandre Sieira
So it does. I had tried list() but not as.list(). Silly me. :) Thank you very much, William. --  Alexandre Sieira CISA, CISSP, ISO 27001 Lead Auditor "The truth is rarely pure and never simple." Oscar Wilde, The Importance of Being Earnest, 1895, Act I On 20 de maio de 2013 at 18:32:3

[R] as.vector with mode="list" and POSIXct

2013-05-20 Thread Alexandre Sieira
on(x) {   retval = list()   for (i in 1:length(x)) retval[[i]] = x[i]   return(retval) } Is there a better way to do this (other than using *apply instead of for above) that better leverages vectorization? Am I missing something here? Thanks! --  Alexandre Sieira CISA, CISSP, ISO 270

Re: [R] Unexpected behavior looping through sequence of dates

2013-03-09 Thread Alexandre Sieira
" argument is a vector of a non-primitive type. That would have saved me a few hours of debugging in the last few days, so I imagine it must be relevant for more people as well. -- Alexandre Sieira CISA, CISSP, ISO 27001 Lead Auditor "The truth is rarely pure and never simple.&qu

[R] Unexpected behavior looping through sequence of dates

2013-03-09 Thread Alexandre Sieira
> for (i in seq(from=d1, to=d2, by="day")) print(class(i)) [1] "numeric" [1] "numeric" This is output from R version 2.15.2 (2012-10-26) on Mac OS X 10.8.2. Is this expected behavior? -- Alexandre Sieira CISA, CISSP, ISO 27001 Lead Auditor "Th