trim_DF | R Documentation |
If the numeric value of the data frame variable does not meet the specified conditions, the function deletes the entire row.
trim_DF(data, trim.var.name, trim.action, trim.thresh)
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:
|
trim.thresh |
numeric; vector of condition threshold values |
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.
data frame without rows with values that do not satisfy the specified conditions.
Elena N. Filatova
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.