Skip to content
Prev 299198 / 398503 Next

7 days confusion over lists

Could you make a reproducible example?
[http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example]
I can't run any of your code as is. A few comments inline.
On Thu, Jul 5, 2012 at 9:44 AM, Wageningen-eR <igor.milosavljevic at wur.nl> wrote:
This almost certainly doesn't work. "Crop$ <- ... " should be a syntax error.
No, it's not a length thing. It might be a partial matching thing though.

x <- list()

x$a <- 5

x$ab <- 10

x$ba <- 15

print(x$b) # where's x$b?

It's recommended to use the double `[[` in programming applications to
avoid this trouble.

Best,
Michael