Essentially a thin convenience wrapper around plyr::rename(x, list(...))
,
except qtag objects have their id.vars/tag.vars/measure.vars attributes properly modified.
rename.cols(.data, ..., warn_missing = TRUE, warn_duplicated = TRUE)# S3 method for default
rename.cols(.data, ..., warn_missing = TRUE,
warn_duplicated = TRUE)
# S3 method for qtag
rename.cols(.data, ..., warn_missing = TRUE,
warn_duplicated = TRUE)
An object that has columns that can be renamed
Key/value pairs to replace in the form oldval="newval"
Print a message if any old names are not actually present in x
Print a message if any name appears more than once in x after the operation.
A copy of the modified object
# NOT RUN {
data(pocmaj)
rename.cols(pocmaj, Ca="Calcium")
pocmaj2 <- as.qtag(pocmaj, id.vars=c("core", "depth"))
pocmaj2 <- rename.cols(pocmaj2, Ca="Calcium")
attr(pocmaj2, "measure.vars")
# }
Run the code above in your browser using DataLab