Learn R Programming

mudata2 (version 1.1.3)

filter_datasets: 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, ...)

# S3 method for default filter_datasets(.data, ...)

filter_data(.data, ...)

# S3 method for default filter_data(.data, ...)

filter_locations(.data, ...)

# S3 method for default filter_locations(.data, ...)

filter_params(.data, ...)

# S3 method for default filter_params(.data, ...)

Value

A subsetted mudata object

Arguments

.data

A mudata object

...

Objects passed to filter on the appropriate table

See Also

filter, select_locations

Examples

Run this code
# 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)

Run the code above in your browser using DataLab