Re: [R] Some kind of inverse of "names"

2012-08-20 Thread Peter Vorpahl
Hi Sergio, 'names' are just an attribute of your list. If all elements of your list are of the same type (i.e. integer in your example) you may try something like 'unlist (li)' or even 'as.numeric(unlist(li))'. This will give you the values you wanted. An other approach is organizig your data n

Re: [R] Some kind of inverse of "names"

2012-08-20 Thread Julio Sergio
Søren Højsgaard math.aau.dk> writes: > > Is this what you want?: > Yes, that is exactly what I wanted! Thanks, --Sergio. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Some kind of inverse of "names"

2012-08-20 Thread Peter Vorpahl
Hi Sergio, 'names' are just an attribute of your list. If all elements of your list are of the same type (i.e. integer in your example) you may try something like 'unlist (li)' or even 'as.numeric(unlist(li))'. This will give you the values you wanted. An other approach is organizig your data n

Re: [R] Some kind of inverse of "names"

2012-08-20 Thread Bert Gunter
Inline -- Bert On Mon, Aug 20, 2012 at 3:19 PM, Julio Sergio Santana wrote: > I wonder if there exists some kind of inverse of the "names" primitive in > R. Let me explain what do I mean: > > If I create a list: > -> li <- list(a=1, b=2, c=3, d=4) > then I can have: > -> names(li) > [1] "a

Re: [R] Some kind of inverse of "names"

2012-08-20 Thread Søren Højsgaard
] On Behalf Of Julio Sergio Santana Sent: 21. august 2012 00:20 To: r-help@r-project.org Subject: [R] Some kind of inverse of "names" I wonder if there exists some kind of inverse of the "names" primitive in R. Let me explain what do I mean: If I create a list: -> li <-

[R] Some kind of inverse of "names"

2012-08-20 Thread Julio Sergio Santana
I wonder if there exists some kind of inverse of the "names" primitive in R. Let me explain what do I mean: If I create a list: -> li <- list(a=1, b=2, c=3, d=4) then I can have: -> names(li) [1] "a" "b" "c" "d" which is, I guess, some kind of vector, since -> typeof(names(li)) [1] "char