remove_variables: Remove Variables / Observations from a Dataset

Description Usage Arguments Value See Also Examples

Description

This function removes variables / obersvations from a dataset based on a percentage of missing data. The results are outputed as a data frame. Furthermore, the resulting data frame can be saved as .csv file in a specified directory.

Usage

1
2
remove_variables(dataset, percentage = NULL, file_name = NULL,
  directory = NULL)

Arguments

dataset

The dataset from which the variables / observations are removed.

percentage

The cut off percentage of missing observations for removing variables, the default is NULL. If a variable is missing more than the specified percentage then the variable is removed from the dataset. With the default set to NULL, all missing observations are removed from the dataset.

file_name

A character object indicating the file name when saving the data frame. The name must include the .csv suffixs. The default is NULL.

directory

A character object specifying the directory where the data frame is to be saved as a .csv file.

Value

Outputs the completed data as a data frame.

See Also

derive_variables, extract_variables, impute_variables, standardise_variables, transform_variables

Examples

1
2
3
4
5
6
# Example 1 - Titanic
descriptive_statistics(dataset = titanic, type = "numeric")
# remove all missing observations form the data frame
remove_variables(dataset = titanic)
# remove all variables that are missing over 15% of their observations
remove_variables(dataset = titanic, percentage = 15)

oislen/BuenaVista documentation built on May 16, 2019, 8:12 p.m.