[R] how to make this get command work?
zadig_1 at excite.com
Thu Dec 18 05:22:03 CET 2014
Thank you. I was flummoxed by late night tiredness.
getElement via ?"[" helped me. I am flubbergusted with your speedy answer.
From: "Bert Gunter" [gunter.berton at gene.com]
Date: 12/17/2014 10:35 PM
To: "ce" <zadig_1 at excite.com>
CC: "r-help at r-project.org" <r-help at r-project.org>
Subject: Re: [R] how to make this get command work?
Read the docs! Go thru an R tutorial.
Genentech Nonclinical Biostatistics
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
On Wed, Dec 17, 2014 at 7:24 PM, ce <zadig_1 at excite.com> wrote:
> Dear all,
> If I have a list like this how I can get an object of it with a variable :
> foo<-list(A = c(1,3), B =c(1, 2), C = c(3, 1))
> var <- "A"
> Error in get(paste("foo$", "A", sep = "")) : object 'foo$A' not found
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help