Learn R Programming

mxfda (version 0.2.2-1)

filter_spatial: Filter Spatial data

Description

function to filter the spatial data slot of the mxFDA object.

Usage

filter_spatial(mxFDAobject, ..., based_on = "meta", force = FALSE)

Value

object of class mxFDA with the spatial slot filtered. See make_mxfda() for more details on object

Arguments

mxFDAobject

object of class mxFDA

...

expressions that return a logical TRUE/FALSE value when evaluated on columns of the meta data slot. These expressions get passed to dplyr::filter() so must be compatible.

based_on

character for which data slot to use for filtering, either 'meta', or 'spatial'. Default to 'meta'.

force

logical whether or not to return empty spatial data if filtering results in 0 rows

Author

Alex Soupir alex.soupir@moffitt.org

References

dplyr::filter()

Examples

Run this code
#load ovarian mxFDA object
data(ovarian_FDA)

#filter ages greater than 50
ovarian_FDA_age50 = filter_spatial(ovarian_FDA, age >= 50, based_on = 'meta')

Run the code above in your browser using DataLab