[R] modifying colnames of tables in a loop

2006-11-16 Thread Werner Wernersen
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

Re: [R] modifying colnames of tables in a loop

2006-11-16 Thread Benilton Carvalho
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) {

Re: [R] modifying colnames of tables in a loop

2006-11-16 Thread Werner Wernersen
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))

Re: [R] modifying colnames of tables in a loop

2006-11-16 Thread Dimitris Rizopoulos
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

Re: [R] modifying colnames of tables in a loop

2006-11-16 Thread Werner Wernersen
- 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

Re: [R] modifying colnames of tables in a loop

2006-11-16 Thread Gabor Grothendieck
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