Naming list objects

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Naming list objects

Wade Wall
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

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: Naming list objects

Gábor Csárdi-2
names(alninc) <- c("F","V","G")

See ?names

Gabor

On Mon, Jan 07, 2008 at 01:35:59PM -0500, Wade Wall wrote:

> 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
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.

--
Csardi Gabor <[hidden email]>    MTA RMKI, ELTE TTK

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: Naming list objects

Daniel Nordlund
In reply to this post by Wade Wall
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf
> Of Wade Wall
> Sent: Monday, January 07, 2008 10:36 AM
> To: [hidden email]
> 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

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: Naming list objects

John Kane-2
In reply to this post by Wade Wall
names(alninc) <- c("F", "V", "G")

--- Wade Wall <[hidden email]> wrote:

> 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
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.