[R] Data frame of different sized lists in a function call
Jonathan Greenberg
greenberg at ucdavis.edu
Thu Jan 28 22:03:17 CET 2010
I'm hoping to get some "best practice" feedback for constructing a
function call which takes an undefined set of DIFFERENT length vectors
-- e.g. say we have two lists:
list1=c(1:10)
list2=c(2:4)
lists = data.frame(list1,list2) coerces those two to be the same length
(recycling list2 to fill in the missing rows) -- what is a quick way of
having each of those lists retain their original lengths? my function
ultimately should look like:
myfunction = function(lists) {
...
}
I'm hoping this can be done with a single line, so the user doesn't have
to pre-construct the data.frame before running the function, if at all
possible.
Thanks!
--j
--
Jonathan A. Greenberg, PhD
Postdoctoral Scholar
Center for Spatial Technologies and Remote Sensing (CSTARS)
University of California, Davis
One Shields Avenue
The Barn, Room 250N
Davis, CA 95616
Phone: 415-763-5476
AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307
More information about the R-help
mailing list