filter_sites_by_md function takes logical expressions for the metadata
pl_sens_meth == 'HR'), and list the sites that met
the criteria from thos supplied
character vector with the sites codes to filter, generally the
metadata tbl object, usually the result of
Logical expressions for the metadata variables, as in
Character indicating how to filter the sites, see details.
.join argument indicates how sites must be filtered between metadata
'and' indicates only sites meeting all conditions for all
metadata classes are returned.
'or' indicates all sites meeting any
condition between classes are returned. For two or more filtes of the same
metadata class, they are combined as 'and'.
A character vector with the sites fullfilling the premises
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
# Let's access the data in "folder". This typically is the folder where the # sapflow data at the desired unit level is (i.e. "RData/plant"), but in this # example we will create a temporal folder with some data to test the function folder <- tempdir() save(ARG_TRE, file = file.path(folder, 'ARG_TRE.RData')) save(ARG_MAZ, file = file.path(folder, 'ARG_MAZ.RData')) save(AUS_CAN_ST2_MIX, file = file.path(folder, 'AUS_CAN_ST2_MIX.RData')) # we need the metadata and the site names metadata <- read_sfn_metadata(folder = folder, .write_cache = TRUE) sites <- sfn_sites_in_folder(folder) # Filter by Heat Ratio method filter_sites_by_md( pl_sens_meth == 'HR', sites = sites, metadata = metadata ) # Both, Heat Ratio and Heat Dissipation filter_sites_by_md( pl_sens_meth %in% c('HR', 'HD'), sites = sites, metadata = metadata ) # more complex, Heat Ratio method AND Woodland/Shrubland biome filter_sites_by_md( pl_sens_meth == 'HR', si_biome == 'Woodland/Shrubland', sites = sites, metadata = metadata, .join = 'and' # default ) # join = 'or' returns sites that meet any condition filter_sites_by_md( pl_sens_meth == 'HR', si_biome == 'Woodland/Shrubland', sites = sites, metadata = metadata, .join = 'or' )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.