>
> apply() operates on arrays and a data frame will be coerced to a matrix
> (which requires all elements to be of the same type). This is documented in
> ?apply.
>

Thanks, I was not aware of that. I implicitly assumed there would be a
specific apply.data.frame.



> This may not be elegant, but why not just use a loop:
>

The thing is that were are going to use this operation on a (very) large
scale in a production environment, on datasets for which nrow >> ncol. So I
would like the most efficient solution and if possibly, avoid looping over
the rows.

Thanks

Jeroen

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to