Functions to examine the number of temporal replicates contained in each
spatial replication level of a dataset.
pplr_site_rep_plot plots the temporal replicates available for each site.
pplr_site_rep produces logical vectors that identify the spatial replicates
with enough temporal replication, or summary tables.
1 2 3 4
An object of class
A number corresponding to the desired annual frequency of
temporal replication. Studies that are
replicated more frequently will be included in the counts and those that
replicated less frequently will be excluded. If
An integer corresponding to the desired duration of temporal replication. Rows corresponding to sites with more replication will be included, while those with less will be excluded.
An integer corresponding to the level of spatial replication
desired. Values between 1 and 5 are possible (though higher levels may not be
present for some datasets). Higher values correspond to higher levels of
spatial nestedness. The default value of
Indicates whether to return a summary table of class
A logical indicating whether to return a copy of the
pplr_site_rep_plot produces a scatterplot showing the sites
spatial_replication_level_1) and years for which data is available.
pplr_site_rep works with any level of spatial replication and produces
either a summary table of temporal replication or a logical vector that can be used
to subset a data set based on the desired frequency and length of time.
input object (invisibly) or a
ggplot2 object. Use
return_plot to control.
tbl or a logical vector of length
return_logical to control.
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 39 40 41 42 43
## Not run: library(ggplot2) library(dplyr) # produce logical vector and subset using it. This can also be piped into a # the plotting function for visiualization good_studies <- pplr_get_data(lterid == 'SEV') %>% .[pplr_site_rep(input = ., duration = 12, rep_level = 3), ] %>% pplr_site_rep_plot() # Or, make a neat summary table and decide where to go from there SEV <- pplr_get_data(lterid == 'SEV') rep_table <- pplr_site_rep(input = SEV, freq = 0.5, duration = 12, return_logical = FALSE) # pplr_site_rep_plot --------------- # create an unmodified figure BNZ <- pplr_get_data(lterid == 'BNZ') pplr_site_rep_plot(BNZ) # Return the figure instead of the data for subsequent modification Antarctica <- pplr_get_data(lterid == 'PAL') pplr_site_rep_plot(Antarctica, return_plot = TRUE) + ggtitle("Penguins Rock!") # Use within pipes. Cannot return and modify the figure this way. pplr_get_data(lterid == 'SEV') %>% pplr_site_rep_plot(return_plot = FALSE) %>% pplr_report_metadata() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.