After importing a file, I always try try to remove spaces from the column names to make referral to column names easier.
Is there a better way to do this other then using transform and then removing the extra column this command creates?
This is what I use now:
names(ctm2)
#tranform function does this, but requires some action
ctm2<-transform(ctm2,dymmyvar=1)
#remove dummy column
ctm2$dymmyvar <- NULL
names(ctm2)
inject.dots <- function(df) {names(df) <- sub(" ", ".", names(df));df}
make.names
function.read.csv/read.table(..., check.names=T)
. And the default is TRUE.