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: jgrn...@hotmail.com, Gchat: jgrn307

______________________________________________
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