Re: [R] columns called X rename Y

2013-01-18 Thread David Winsemius
On Jan 18, 2013, at 3:13 PM, Jeff Newmiller wrote: > If you have a lot of names to change, or you need to do it regularly, you can > use something like: > > renames <- read.table(text= > "oldname newname > constant c > numbers b > ", header=TRUE, as.is=TRUE ) > names(seba)[match(renames$oldname

Re: [R] columns called X rename Y

2013-01-18 Thread Jeff Newmiller
If you have a lot of names to change, or you need to do it regularly, you can use something like: renames <- read.table(text= "oldname newname constant c numbers b ", header=TRUE, as.is=TRUE ) names(seba)[match(renames$oldname, names(seba))] <- renames$newnames --

Re: [R] columns called X rename Y

2013-01-18 Thread Jose Iparraguirre
013 18:14 To: R-help Subject: [R] columns called X rename Y I have a data. frame to which you want to change the names to some of their columns. For example: > seba <- data.frame ('constant' = 3, 'numbers' = 1: 10, 'letters' = LETTERS [1:10], otros = 2:11) List the

Re: [R] columns called X rename Y

2013-01-18 Thread Rui Barradas
Hello, Try the following. names(seba)[grep("numbers", names(seba))] <- "b" names(seba)[grep("constant", names(seba))] <- "c" names(seba) Hope this helps, Rui Barradas Em 18-01-2013 18:14, Sebastian Kruk escreveu: I have a data. frame to which you want to change the names to some of their

[R] columns called X rename Y

2013-01-18 Thread Sebastian Kruk
I have a data. frame to which you want to change the names to some of their columns. For example: > seba <- data.frame ('constant' = 3, 'numbers' = 1: 10, 'letters' = LETTERS [1:10], otros = 2:11) List their names: > names (Seba) [1] "constant" "numbers" "letters" I want to rename c the column