Hello everyone,
I need some help with lists inside lists (a good way to emulate a struct)\
Assume that there is a small list called fred:
fred - list(happy = 1:10, name = squash)
and a big list called bigfred that includes fred list 5 times
bigfred - rep(fred,5)
Is it possible somehow to
I'm confused by what you are looking for.
There's some slight possibility that you
are looking for double bracket subscripting
with a vector:
list(a=1:5, b=letters)[[c(2,4)]]
[1] d
On 22/09/2010 10:58, Alaios wrote:
Hello everyone,
I need some help with lists inside lists (a good way to
Also, it may be that you want bigfred to be a list of 5 lists each of 2
elements (happy and name) rather than a list of 10 elements.
Thus (also using double bracketing)
fred- list(happy = 1:10, name = squash)
bigfred - replicate(5, fred, FALSE)
bigfred[[2]][[2]]
hth
Keith J
Patrick Burns
Hi:
I believe we had this discussion yesterday,
http://r.789695.n4.nabble.com/Object-oriented-programming-in-R-td2538541.html#a2538916
but since you chose to repeat that message, it clearly wasn't enough, so
start with
http://cran.r-project.org/doc/manuals/R-intro.html#Lists
Great one!
Thanks this will simplify a lot addresing.
Best REgards
From: Keith Jewell k.jew...@campden.co.uk
To: r-h...@stat.math.ethz.ch
Sent: Wed, September 22, 2010 1:25:27 PM
Subject: Re: [R] efficient list indexing
Also, it may be that you want bigfred
For some reason I did not receive your email.
Sorry for the inconvenience caused
From: Dennis Murphy djmu...@gmail.com
Cc: Rhelp r-help@r-project.org
Sent: Wed, September 22, 2010 1:46:28 PM
Subject: Re: [R] efficient list indexing
Hi:
I believe we had
6 matches
Mail list logo