trim_DF: Trim data frame

trim_DFR Documentation

Trim data frame

Description

If the numeric value of the data frame variable does not meet the specified conditions, the function deletes the entire row.

Usage

trim_DF(data, trim.var.name, trim.action, trim.thresh)

Arguments

data

data frame

trim.var.name

character; vector of data frame column names with numeric variables that should be tested for conditions

trim.action

character; vector of test conditions; possible values are: "more", "eqmore" (more or equal), "less", "eqless" (less or equal).

trim.thresh

numeric; vector of condition threshold values

Details

This function takes the vector of data frame variables and for each of them test if they satisfy the specified conditions. Not satisfying values are deleted with the entire data frame row. You may set as many conditions for as many variables as you like.

trim.values must be exact column names as in data frame.

Value

data frame without rows with values that do not satisfy the specified conditions.

Author(s)

Elena N. Filatova

Examples

data <- data.frame ("a" = 1:10, "b" = 101:110)
trim_DF (data, trim.var.name = c("a", "b"), trim.action = c("less", "eqmore"),
       trim.thresh = c(6, 104))


disprose documentation built on March 19, 2022, 2:15 a.m.

Related to trim_DF in disprose...