View source: R/flat_table_transform.R
select_instances_by_comparison | R Documentation |
Select only the indicated instances from the flat table by comparison.
select_instances_by_comparison(ft, not, attributes, comparisons, values)
## S3 method for class 'flat_table'
select_instances_by_comparison(
ft,
not = FALSE,
attributes = NULL,
comparisons,
values
)
ft |
A |
not |
A boolean. |
attributes |
A list of name vectors. |
comparisons |
A list of comparison operator vectors. |
values |
A list of value vectors. |
The elements of the three parameter lists correspond (all three must have the same structure and length or be of length 1). AND is performed for each combination of attribute, operator and value within each element of each list and OR between elements of the lists.
If the parameter not
is true, the negation operation will be applied to the
result.
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()
,
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_by_comparison(attributes = 'Species',
comparisons = '>=',
values = 'v')
ft <- flat_table('ft_num', ft_num) |>
select_instances_by_comparison(
not = FALSE,
attributes = c('Year', 'Year', 'WEEK'),
comparisons = c('>=', '<=', '=='),
values = c('1962', '1964', '2')
)
ft <- flat_table('ft_num', ft_num) |>
select_instances_by_comparison(
not = FALSE,
attributes = c('Year', 'Year', 'WEEK'),
comparisons = c('>=', '<=', '=='),
values = list(c('1962', '1964', '2'),
c('1962', '1964', '4'))
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.