re_name | R Documentation |
Renombra los identificadores de columna, substituyendo '.' por '_', eliminando acentos, ec.
re_name(data, char = NULL, newchar = NULL)
char |
a character string specifying the characters to be translated. If a character vector of length 2 or more is supplied, the first element is used with a warning. |
newchar |
a character string specifying the translations. If a character vector of length 2 or more is supplied, the first element is used with a warning. |
dat |
data frame que contiene las variables a evaluar or character vector with variable names. |
Miriam Mota mmota.foix@gmail.com
df <- data.frame('nombre+a-apellido' = as.factor(rbinom(50,1,.40)) , 'dni...NIF' = rnorm(50,10,1), 'Y/X'=as.factor(rbinom(50,1,.40)),'ibm 2' = rnorm(50,10,1)) names(df) <- c('nombre+a-apellido', 'dni...NIF', 'Y/X', 'ibm 2') ## modifiquem noms per a que siguin "incorrectes" df <- re_name(data = df) df <- re_name(data = df, char = "+-", newchar = "__")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.