mask_values: mask values

Description Usage Arguments Details Value Examples

View source: R/fun-mask_values.R

Description

Mask certain values in the screen object to be omitted in downstream analysis.

Usage

1
mask_values(scr, cols, preds)

Arguments

scr

a data.frame

cols

character vector of column names to be masked

preds

logical predicate that will determine masking or a list of such predicates of the same length as cols: a single predicate will be applied to all cols, multiple predicates will be applied to the respective cols; predicates can be given as bare expression or character strings

Details

Selected values (observation-variable fields) can be replaced with NAs, so that they are omitted from normalization, standardization, and hit scoring.

Value

A modified data.frame where the masked values are set to NA.

Examples

1
2
3
4
5
Iris <- rbind(head(iris), tail(iris))
mask_values(Iris, "Sepal.Length", Species == "setosa")
mask_values(Iris, "Sepal.Length", "Species == \"setosa\"")
mask_values(Iris, c("Sepal.Length", "Sepal.Width"), Species == "setosa")
mask_values(Iris, c("Sepal.Length", "Sepal.Width"), list(Species == "setosa", Species == "virginica"))

olobiolo/siscreenr documentation built on Nov. 26, 2021, 3:08 p.m.