Skip to content

Instantly share code, notes, and snippets.

@bfoste01
Created July 24, 2014 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bfoste01/7a63896332290c01323f to your computer and use it in GitHub Desktop.
Save bfoste01/7a63896332290c01323f to your computer and use it in GitHub Desktop.
#get variable names for mtcars dataset in rbase
colnames(mtcars)
#if yow want to recode variables the lazy way
fix(mtcars) #downside is that it isn't hard coded, and therefore not reproducible
#use the reshape package
library(reshape)
test <- rename(mtcars, c(disp="renamedisp")) #reproducible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment