Learn R Programming

Momocs (version 1.1.6)

filter: Filters (ala dplyr) on Momocs objects

Description

Return shapes with matching conditions, from the $fac. See examples and ?dplyr::filter.

Usage

filter(.data, ...)

Arguments

.data
a Coo, Coe, PCA object
...
logical conditions

Value

a Momocs object of the same class.

Details

dplyr verbs are maintained.

See Also

Other handling functions: arrange, at_least, chop, combine, dissolve, mutate, rename, rm_uncomplete, rw_fac, sample_frac, sample_n, select, slice, subset.Coo, transmute

Examples

Run this code
olea
# we retain on dorsal views
filter(olea, view=="VD")
# only dorsal views and Aglan+PicMa varieties
filter(olea, view=="VD", var %in% c("Aglan", "PicMa"))
# we create an id column and retain the 120 first shapes
olea %>% mutate(id=1:length(olea)) %>% filter(id > 120)

Run the code above in your browser using DataLab