Re: [R] rename and concatenate name of columns

2013-06-16 Thread R. Michael Weylandt
On Sat, Jun 15, 2013 at 1:45 AM, David Winsemius wrote: > > On Jun 14, 2013, at 1:25 PM, Bert Gunter wrote: > >> For the record: >> >> ... >> >> >>> >>> A bit of commentary: Something did happen. It's just that you didn't do >>> anything with _what_ happened. The copy of the 'dataset

Re: [R] rename and concatenate name of columns

2013-06-14 Thread David Winsemius
On Jun 14, 2013, at 1:25 PM, Bert Gunter wrote: > For the record: > > ... > > >> >> A bit of commentary: Something did happen. It's just that you didn't do >> anything with _what_ happened. The copy of the 'dataset'-object got modified >> but you never returned it from the funct

Re: [R] rename and concatenate name of columns

2013-06-14 Thread Bert Gunter
For the record: ... > > A bit of commentary: Something did happen. It's just that you didn't do > anything with _what_ happened. The copy of the 'dataset'-object got modified > but you never returned it from the function, and and also didn't reassign it > to the original 'dataset'

Re: [R] rename and concatenate name of columns

2013-06-14 Thread David Winsemius
On Jun 14, 2013, at 6:34 AM, Arman Eshaghi wrote: > Dear all, > > I have different data frames for which I would like to modify names of each > column such that the new name would include the name of the first column > added to the name of other columns; I came up with the following code. > Noth

Re: [R] rename and concatenate name of columns

2013-06-14 Thread Arman Eshaghi
Thanks all! On Fri, Jun 14, 2013 at 6:40 PM, Rainer Schuermann < rainer.schuerm...@gmx.net> wrote: > df1 <- data.frame( A = runif( 10 ), B = runif( 10 ) * 5, C = runif( 10 ) * > 10, D = runif( 10 ) * 20 ) > df2 <- data.frame( X = runif( 10 ), Y = runif( 10 ) * 5, Z = runif( 10 ) * > 10 ) > renam

Re: [R] rename and concatenate name of columns

2013-06-14 Thread Rainer Schuermann
df1 <- data.frame( A = runif( 10 ), B = runif( 10 ) * 5, C = runif( 10 ) * 10, D = runif( 10 ) * 20 ) df2 <- data.frame( X = runif( 10 ), Y = runif( 10 ) * 5, Z = runif( 10 ) * 10 ) rename_columns <- function( dataset ) { for( i in 2:ncol( dataset ) ) colnames( dataset )[i]

Re: [R] rename and concatenate name of columns

2013-06-14 Thread Ista Zahn
al Message ----- > From: Arman Eshaghi > To: r-help@r-project.org > Cc: > Sent: Friday, June 14, 2013 9:34 AM > Subject: [R] rename and concatenate name of columns > > Dear all, > > I have different data frames for which I would like to modify names of each > column such

Re: [R] rename and concatenate name of columns

2013-06-14 Thread arun
ne 14, 2013 9:34 AM Subject: [R] rename and concatenate name of columns Dear all, I have different data frames for which I would like to modify names of each column such that the new name would include the name of the first column added to the name of other columns; I came up with the followi

[R] rename and concatenate name of columns

2013-06-14 Thread Arman Eshaghi
Dear all, I have different data frames for which I would like to modify names of each column such that the new name would include the name of the first column added to the name of other columns; I came up with the following code. Nothing changes when I run the following code. I would be grateful i