Question 1:
I have a long list of variable names such as

first <- c("one","two","three")

and what I want to do is create a list of lists ... where the names of each of 
overall lists components are  "one","two", and "three".

This is the same result as 

second <- list(one=list(),two=list(),three=list())

Is there a way to exploit lapply to convert a list such as first to a list of 
empty lists such as second?

Question 2:

In a parallel routine using foreach and doMPI have to put calcualted values 
into a list of lists such as 

list(one=one,
     two=two,
     three=three)

It uses the same (large) list of variable names as first in question 1.  Is 
there a simpler way to accomplish this with a lapply statement?


I've tried several permutations but no luck! Thanks a bunch.

Jim

===============================
Dr. Jim Maas
University of East Anglia

______________________________________________
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