filter_by_attribute: Filter by attribute

filter_by_attributeR Documentation

Filter by attribute

Description

Filters a configuration_set or configuration_fit_set by one or more attributes' values.

Usage

filter_by_attribute(x, attribute, as.boolean = FALSE, ...)

Arguments

x

A configuration_set or configuration_fit_set.

attribute

A named list containing the filter criteria. Each element in the list represents an attribute to filter on. A list element's name should be an attribute name. The element value should include one or more attribute values to select configuration or configuration_fit objects. To be selected, a configuration or configuration_fit object must match with each attribute in the filter.

as.boolean

When TRUE, the function returns a boolean vector for whether each configuration or configuration_fit object matched the attribute filter. When FALSE, the function returns the matched objects.

Value

A subset of objects that match the filter criteria or a boolean vector that can be used to filter a configuration_set or configuration_fit_set, depending on the as.boolean parameter.

See Also

get_attribute, configuration_set, configuration_fit_set

Examples

f_set <- c(star(2), star(3), star(4))
filter_by_attribute(f_set, list(group_size = 2:3))
f_set[filter_by_attribute(f_set, list(group_size = 2:3), as.boolean = TRUE)]

stephen-l-jones/SmallGroupNetwork documentation built on April 25, 2022, 11:15 p.m.