I'm sure there is a more general way to ask this question but how do
you use the elements of a character vector as names of objects in an
expression?
For example, say you have:
a = c(1,3,5,7)
b = c(2,4,6,8)
n=c(a,b)
and you want to use the names a and b in a function (e.g. sum)
-project.org
Sent: Thursday, February 05, 2009 5:10 PM
Subject: [R] eval and as.name
I'm sure there is a more general way to ask this question but how do you
use the elements of a character vector as names of objects in an
expression?
For example, say you have:
a = c(1,3,5,7)
b = c(2,4,6,8)
n
Fuchs Ira wrote:
I'm sure there is a more general way to ask this question but how do
you use the elements of a character vector as names of objects in an
expression?
For example, say you have:
a = c(1,3,5,7)
b = c(2,4,6,8)
n=c(a,b)
and you want to use the names a and b in a function
: [R] eval and as.name
I'm sure there is a more general way to ask this question but how do
you use the elements of a character vector as names of objects in an
expression?
For example, say you have:
a = c(1,3,5,7)
b = c(2,4,6,8)
n=c(a,b)
and you want to use the names a and b
Hi,
Why do you use the equals sign for assignment instead of the arrow, is this
equal?
Mvh.
Marie
On Thu, Feb 5, 2009 at 11:59 PM, Wacek Kusnierczyk
waclaw.marcin.kusnierc...@idi.ntnu.no wrote:
you may want to avoid this sort of indirection by using lists with named
components:
d =
Marie Sivertsen wrote:
Hi,
Why do you use the equals sign for assignment instead of the arrow, is this
equal?
equal? you mean equivalent? mostly, yes. briefly, this is why:
1. a copy-over from other programming languages;
2. to avoid learning yet another operator;
3. after having
:25:39 2009
Subject: RE: [R] eval and as.name
Hi: below works but it's not much shorter than yours. there must
be a
better way so I'm sending off line in order to encourage better
replies.
sum(get(n[1]),get(n[2]))
On Thu, Feb 5, 2009 at 5:10 PM, Fuchs Ira wrote:
I'm
the elements of the character vector.
Thanks,
Ira
- Original Message -
From: markle...@verizon.net markle...@verizon.net
To: Fuchs Ira irafu...@gmail.com
Sent: Thu Feb 05 17:25:39 2009
Subject: RE: [R] eval and as.name
Hi: below works but it's not much shorter than yours. there must
the elements of the character vector.
Thanks,
Ira
- Original Message -
From: markle...@verizon.net markle...@verizon.net
To: Fuchs Ira irafu...@gmail.com
Sent: Thu Feb 05 17:25:39 2009
Subject: RE: [R] eval and as.name
Hi: below works but it's not much shorter than yours. there must
Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no writes:
equal? you mean equivalent? mostly, yes. briefly, this is why:
1. a copy-over from other programming languages;
2. to avoid learning yet another operator;
3. after having learned the other operator, to avoid that ugly
10 matches
Mail list logo