Skip to content
Prev 259185 / 398502 Next

editor: not possible to change the variable name

Hi Matthias,

If you know the column number you want to change, it is pretty straightforward.

## use the builtin mtcars dataset as an example
## and store it in variable, 'x'
x <- mtcars
## change the second column name to "cylinder"
colnames(x)[2] <- "cylinder"

## compare the column names of 'x' with the unchanged 'mtcars'
colnames(mtcars)
colnames(x)

You might also consider R-sig mac if it is at all related to your OS.
I have never really used macs so I am unfamiliar with Rs default
interface on them, though I would assume it is similar.

Good luck,

Josh
On Fri, May 6, 2011 at 3:05 PM, Matthias Neff <MatthiasNeff at gmx.ch> wrote: