[R] When I cbind the POSIXct gets lost

Gabor Grothendieck ggrothendieck at gmail.com
Tue Feb 12 19:46:17 CET 2008


Please provide reproducible code.  Try this:

do.call("rbind", by(iris, iris$Species, colMeans))

On Feb 12, 2008 1:34 PM, Allen S. Rout <asr at ufl.edu> wrote:
> "Gabor Grothendieck" <ggrothendieck at gmail.com> writes:
>
> > The point is don't use cbind -- use data.frame.
>
> Is there a conventional way to use data.frame instead of cbind when
> processing a 'by'?
>
> My code is littered with:
>
> foo  <- data.frame(cbind(by( /* yadda */ )))
>
> and I've had a problem similar to the Original Poster, resulting in
> some ugly reordering, so I do the as.POSIXct _after_ the
> data.frame(cbind())
>
>
>
> - Allen S. Rout
>
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list