Hi,
I have a list with the names of tables, e.g.
l - c(t1,t2,t3)
and I want to change the colnames of each of the
tables in a for loop like this:
for (x in l) {
colnames(eval(x)) - lower.case(colnames(eval(x)))
}
This does not work but could someone give me some help
to get on the right
how about:
for (x in l) colnames(get(x)) - lower.case(colnames(get(x)))
b
On Nov 16, 2006, at 9:01 AM, Werner Wernersen wrote:
Hi,
I have a list with the names of tables, e.g.
l - c(t1,t2,t3)
and I want to change the colnames of each of the
tables in a for loop like this:
for (x in l) {
That's almost perfect! Only the operation
colnames(get(x)) -
seems not to be defined.
Now I can't figure out how to assign the colnames of
the object in the original environment.
Thanks, Benilton!
--- Benilton Carvalho [EMAIL PROTECTED] schrieb:
how about:
for (x in l) colnames(get(x))
Message -
From: Werner Wernersen [EMAIL PROTECTED]
To: Benilton Carvalho [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Sent: Thursday, November 16, 2006 4:06 PM
Subject: Re: [R] modifying colnames of tables in a loop
That's almost perfect! Only the operation
colnames(get(x)) -
seems
- Original Message -
From: Werner Wernersen [EMAIL PROTECTED]
To: Benilton Carvalho [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Sent: Thursday, November 16, 2006 4:06 PM
Subject: Re: [R] modifying colnames of tables in a
loop
That's almost perfect! Only the operation
colnames
Subject: Re: [R] modifying colnames of tables in a
loop
That's almost perfect! Only the operation
colnames(get(x)) -
seems not to be defined.
Now I can't figure out how to assign the colnames
of
the object in the original environment.
Thanks, Benilton!
--- Benilton