[R] Naming list objects

Daniel Nordlund res90sx5 at verizon.net
Mon Jan 7 19:43:47 CET 2008


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
> Of Wade Wall
> Sent: Monday, January 07, 2008 10:36 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Naming list objects
> 
> Hi all,
> 
> I am trying to name list objects, but am having trouble doing so.  At the
> moment I have list alninc that has 3 objects and I can refer to them as
> alninc[[1]]  . . .alninc[[3]].  I would like to refer to them as alninc$F,
> alninc$V and alninc$G.  How do I do this?  This appears to be an elementary
> question, but I can't find the solution anywhere.
> 
> Thanks
> 
> Wade Wall
> 

Wade,

How about 

names(alninc) <- c('F','V','G')

Hope this is helpful,

Dan 

Daniel Nordlund
Bothell, WA USA




More information about the R-help mailing list