This is FAQ 7.21
The most important part of that answer is the last few lines where it says
in effect "Don't Do This" and shows the basics of using a list instead.
On Mon, Apr 29, 2013 at 5:07 AM, Rui Esteves wrote:
> Hello,
>
> This is very basic and very frustrating.
>
> Suppose this:
> >A=5
Hi, res<- unlist(mget(ls()))
names(res)<-NULL
res
#[1] 5 5 10
A.K.
- Original Message -
From: Rui Esteves
To: r-help@r-project.org
Cc:
Sent: Monday, April 29, 2013 7:07 AM
Subject: [R] How to "call" an object given a string?
Hello,
This is very basic and
Hi Rui,
how about this
sapply(ls(),get)
cheers
Am 29.04.2013 13:07, schrieb Rui Esteves:
> Hello,
>
> This is very basic and very frustrating.
>
> Suppose this:
>> A=5
>> B=5
>> C=10
>
>> ls()
> "A"
> "B"
> "C"
>
> I would like this
>> xpto()
> 5
> 5
> 10
>
> How can I do xpto()?
>
> Thank
Hello,
This is very basic and very frustrating.
Suppose this:
>A=5
>B=5
>C=10
> ls()
"A"
"B"
"C"
I would like this
>xpto()
5
5
10
How can I do xpto()?
Thanks
Rui
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
htt
4 matches
Mail list logo