View source: R/Proxytools_helpers.R
clean_timeseries | R Documentation |
Remove NAs and aggregate non-unique timesteps in zoo objects
clean_timeseries(
xin,
remove_na = TRUE,
aggregation = TRUE,
aggregation_fun = mean
)
xin |
Proxytibble with proxy data in 'zoo::zoo' format, or irregular time series object ('zoo::zoo'), xin can be multivariate |
remove_na |
Flag if NAs should be removed |
aggregation |
Flag if non-unique timesteps should be merged |
aggregation_fun |
Function for merging non-unique timesteps |
Proxytibble with proxy data in 'zoo::zoo' format, or irregular time series object ('zoo::zoo')
aggregate (from 'stats') for merging non-unique timesteps
# Load Monticchio example data from PTBoxProxydata
library(PTBoxProxydata)
mng <- PTBoxProxydata::ProxyDataManager()
monticchiodata <- PTBoxProxydata::load_set(mng,'monticchio_testset',zoo_format = 'zoo', force_file=TRUE)
# Clean proxy data time series
monticchiodata_cleaned <- clean_timeseries(monticchiodata)
# Clean zoo time series
monticchiozoo_cleaned <- clean_timeseries(monticchiodata$proxy_data[[1]])
# Plot zoo data
plot(monticchiozoo_cleaned)
plot(monticchiodata_cleaned$proxy_data[[1]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.