This object uses standard evalutation to subset a mudata object using character vectors of datasets, params, and locations. The result is subsetted such that all rows in the data table are documented in the other tables (provided) they were to begin with. It is preferred to use select_locations, select_params, and select_datasets to subset a mudata object, or filter_data, filter_locations, filter_params, and filter_datasets to subset by row while maintaining internal consistency.
# S3 method for mudata subset(x, ..., datasets = NULL, params = NULL, locations = NULL)
x | The object to subset |
---|---|
... | Used to filter the data table |
datasets | Vector of datasets to include |
params | Vector of parameters to include |
locations | Vector of locations to include |
A subsetted mudata object
select_locations, select_params, select_datasets, filter_data, filter_locations, filter_params, and filter_datasets
#> A mudata object aligned along "date" #> distinct_datasets(): "ecclimate" #> distinct_locations(): "GREENWOOD A", "KENTVILLE CDA CS" #> distinct_params(): "maxtemp", "mintemp" #> src_tbls(): "data", "locations" ... and 3 more #> #> tbl_data() %>% head(): #> # A tibble: 6 x 6 #> dataset location param date value flags #> <chr> <chr> <chr> <date> <dbl> <chr> #> 1 ecclimate KENTVILLE CDA CS maxtemp 1999-07-01 28.5 <NA> #> 2 ecclimate KENTVILLE CDA CS maxtemp 1999-07-02 30.7 <NA> #> 3 ecclimate KENTVILLE CDA CS maxtemp 1999-07-03 26.4 <NA> #> 4 ecclimate KENTVILLE CDA CS maxtemp 1999-07-04 28.6 <NA> #> 5 ecclimate KENTVILLE CDA CS maxtemp 1999-07-05 26 <NA> #> 6 ecclimate KENTVILLE CDA CS maxtemp 1999-07-06 25.3 <NA>