View source: R/utils.removeNamelessVars.R
removeNamelessVars | R Documentation |
When importing data from Excel or Calc there are some quirks that can happend because of the format of the files. One of those quirks is that "phantom" variables are created, usually with names like "___14"
removeNamelessVars(data, starts.with = c("_"), verbose = TRUE, DEBUG = FALSE)
data |
data.frame to be "cleaned" of empty nameless variables |
starts.with |
Vector with "starting" strings that will ve removed to detect nameless vars (default = c("_")) |
verbose |
logical; to be more or less verbose |
DEBUG |
logical; to be extra verbose |
This function tracks those variables and removes them from the data.frame
data.frame with the resulting data.frame without the problematic variables
data <- mtcars data$`___1` <- NA removeNamelessVars(data) data$`___1` <- 1 removeNamelessVars(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.