View source: R/flat_table_transform.R
| select_instances | R Documentation |
Select only the indicated instances from the flat table.
select_instances(ft, not, attributes, values)
## S3 method for class 'flat_table'
select_instances(ft, not = FALSE, attributes = NULL, values)
ft |
A |
not |
A boolean. |
attributes |
A vector of names. |
values |
A list of value vectors. |
Several values can be indicated for attributes (performs an OR operation) or several attributes and a value for each one (performs an AND operation).
If the parameter not is true, the reported values are those that are not
included.
A flat_table object.
flat_table
Other flat table transformation functions:
add_custom_column(),
remove_instances_without_measures(),
replace_empty_values(),
replace_string(),
replace_unknown_values(),
select_attributes(),
select_instances_by_comparison(),
select_measures(),
separate_measures(),
transform_attribute_format(),
transform_from_values(),
transform_to_attribute(),
transform_to_measure(),
transform_to_values()
ft <- flat_table('iris', iris) |>
select_instances(attributes = c('Species'),
values = c('versicolor', 'virginica'))
ft <- flat_table('ft_num', ft_num) |>
select_instances(
not = TRUE,
attributes = c('Year', 'WEEK'),
values = list(c('1962', '2'), c('1964', '2'))
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.