Learn R Programming

DCEM (version 1.0.0)

trim_data: trim_data: Part of DCEM package.

Description

Removes the specified column(s) from the dataset.

Usage

trim_data(columns, data)

Arguments

columns

(string): A comma separated list of column(s) that needs to be removed from the dataset. Default: ''

data

(dataframe): Dataframe containing the input data.

Value

A dataframe with the specified column(s) removed from it.

References

Using data to build a better EM: EM* for big data.

Hasan Kurban, Mark Jenne, Mehmet M. Dalkilic (2016) <https://doi.org/10.1007/s41060-017-0062-1>.

Examples

Run this code
# NOT RUN {
# Remove a range of columns. Generally, the columns containing the labels or
# redundant values (such as all 0's) should be removed before training the model.

trim_data("1,2", data.frame(x1=sample(1:100,10),
x2=sample(500:1000, 10), x3=sample(-100:0,10)))

# Remove a single column.

trim_data("2", data.frame(x1=sample(1:100,10),
x2=sample(500:1000, 10), x3=sample(-100:0,10)))

# }

Run the code above in your browser using DataLab