removeNamelessVars: Remove Nameless Variables

View source: R/utils.removeNamelessVars.R

removeNamelessVarsR Documentation

Remove Nameless Variables

Description

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"

Usage

removeNamelessVars(data, starts.with = c("_"), verbose = TRUE, DEBUG = FALSE)

Arguments

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

Details

This function tracks those variables and removes them from the data.frame

Value

data.frame with the resulting data.frame without the problematic variables

Examples


data <- mtcars
data$`___1` <- NA

removeNamelessVars(data)

data$`___1` <- 1

removeNamelessVars(data)



feranpre/feR documentation built on Nov. 22, 2022, 2:29 a.m.