removenacols {lares} | R Documentation |
Remove/Drop Columns in which ALL or SOME values are NAs
Description
This function lets the user remove all columns that have some or all values as NAs
This function lets the user remove all rows that have some or all values as NAs
Usage
removenacols(df, all = TRUE, ignore = NULL)
removenarows(df, all = TRUE)
numericalonly(df, dropnacols = TRUE, logs = FALSE, natransform = NA)
Arguments
df |
Data.frame |
all |
Boolean. Remove rows which contains ONLY NA values. If set to FALSE, rows which contains at least one NA will be removed |
ignore |
Character vector. Column names to ignore validation. |
dropnacols |
Boolean. Drop columns with only NA values? |
logs |
Boolean. Calculate log(x)+1 for numerical columns? |
natransform |
String. "mean" or 0 to impute NA values. If set to NA no calculation will run. |
Value
data.frame with removed columns.
data.frame with removed rows.
data.frame with all numerical columns selected.
See Also
Other Data Wrangling:
balance_data()
,
categ_reducer()
,
cleanText()
,
date_cuts()
,
date_feats()
,
file_name()
,
formatHTML()
,
holidays()
,
impute()
,
left()
,
normalize()
,
num_abbr()
,
ohe_commas()
,
ohse()
,
quants()
,
replaceall()
,
replacefactor()
,
textFeats()
,
textTokenizer()
,
vector2text()
,
year_month()
,
zerovar()
Other Data Wrangling:
balance_data()
,
categ_reducer()
,
cleanText()
,
date_cuts()
,
date_feats()
,
file_name()
,
formatHTML()
,
holidays()
,
impute()
,
left()
,
normalize()
,
num_abbr()
,
ohe_commas()
,
ohse()
,
quants()
,
replaceall()
,
replacefactor()
,
textFeats()
,
textTokenizer()
,
vector2text()
,
year_month()
,
zerovar()
Other Data Wrangling:
balance_data()
,
categ_reducer()
,
cleanText()
,
date_cuts()
,
date_feats()
,
file_name()
,
formatHTML()
,
holidays()
,
impute()
,
left()
,
normalize()
,
num_abbr()
,
ohe_commas()
,
ohse()
,
quants()
,
replaceall()
,
replacefactor()
,
textFeats()
,
textTokenizer()
,
vector2text()
,
year_month()
,
zerovar()
Examples
data(dft) # Titanic dataset
str(dft)
numericalonly(dft) %>% head()
numericalonly(dft, natransform = "mean") %>% head()