Skip to contents

Select only the indicated instances from the flat table.

Usage

select_instances(ft, not, attributes, values)

# S3 method for flat_table
select_instances(ft, not = FALSE, attributes = NULL, values)

Arguments

ft

A flat_table object.

not

A boolean.

attributes

A vector of names.

values

A list of value vectors.

Value

A flat_table object.

Details

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.

Examples


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'))
  )