trim_DF: Trim data frame

Description Usage Arguments Details Value Author(s) Examples

Description

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

Usage

1
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

1
2
3
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 Jan. 6, 2022, 1:07 a.m.

Related to trim_DF in disprose...