[R] automatically generate the output name of my "for" loops

Greg Snow Greg.Snow at imail.org
Wed Jun 15 00:27:03 CEST 2011


If the list is simple enough, then you probably want the "unlist" function, otherwise you will probably need to use the "sapply" function to grab and/or process the important pieces in each list element.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of jiliguala
> Sent: Tuesday, June 14, 2011 4:24 PM
> To: r-help at r-project.org
> Subject: Re: [R] automatically generate the output name of my "for"
> loops
> 
> 
> thanks, Greg Snow-2.
> 
> here i hav a question, how can i save the value of a list to a vector
> or a
> matrix? say,
> i have a list (data1) and a vector or a matrix (data2).
> 
> if i made like this,
> 
> data2 <- as.vector(data1)
> 
> it does not change anything, the data2 is still a list.
> 
> what i want to do is to creat a vector or a matrix to save the value of
> the
> list.
> 
> thanks for helping
> 
> daniel
> 
> 
> --
> View this message in context:
> http://r.789695.n4.nabble.com/automatically-generate-the-output-name-
> of-my-for-loops-tp3592160p3598027.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> 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