filterers: Subset a mudata object by complex expression

filter_datasetsR Documentation

Subset a mudata object by complex expression

Description

These methods allow more complex selection criteria than select_datasets and family, which only use the identifier values. These methods first subset the required table using the provided expression, then subset other tables to ensure internal consistency.

Usage

filter_datasets(.data, ...)

## Default S3 method:
filter_datasets(.data, ...)

filter_data(.data, ...)

## Default S3 method:
filter_data(.data, ...)

filter_locations(.data, ...)

## Default S3 method:
filter_locations(.data, ...)

filter_params(.data, ...)

## Default S3 method:
filter_params(.data, ...)

Arguments

.data

A mudata object

...

Objects passed to filter on the appropriate table

Value

A subsetted mudata object

See Also

filter, select_locations

Examples

# select only locations with a latitude above 45
ns_climate %>%
  filter_locations(latitude > 45)

# select only params measured in mm
ns_climate %>%
  filter_params(unit == "mm")

# select only june temperature from ns_climate
library(lubridate)
ns_climate %>%
  filter_data(month(date) == 6)


mudata2 documentation built on Jan. 22, 2023, 1:48 a.m.