Re: [R] Extracting a column name in loop?

2009-07-09 Thread Moshe Olshansky
If df is your dataframe then names(df) contains the column names and so names(df)[i] is the name of i-th column. --- On Thu, 9/7/09, mister_bluesman mister_blues...@hotmail.com wrote: From: mister_bluesman mister_blues...@hotmail.com Subject: [R] Extracting a column name in loop? To: r

Re: [R] Extracting a column name in loop?

2009-07-09 Thread mister_bluesman
Thank you both for that. Much appreciated. mister_bluesman wrote: Hi, I am writing a script that will address columns using syntax like: data_set[,1] to extract the data from the first column of my data set, for example. This code will be placed in a loop (where the column

[R] Extracting a column name in loop?

2009-07-08 Thread mister_bluesman
Hi, I am writing a script that will address columns using syntax like: data_set[,1] to extract the data from the first column of my data set, for example. This code will be placed in a loop (where the column reference will be placed by a variable). What I also need to do is extract the

Re: [R] Extracting a column name in loop?

2009-07-08 Thread Mark Knecht
On Wed, Jul 8, 2009 at 8:41 AM, mister_bluesmanmister_blues...@hotmail.com wrote: Hi, I am writing a script that will address columns using syntax like: data_set[,1] to extract the data from the first column of my data set, for example. This code will be placed in a loop (where the column