paleodata_interpolation: Interpolation functions for irregular time series

View source: R/Proxytools_tools.R

paleodata_interpolationR Documentation

Interpolation functions for irregular time series

Description

Interpolation functions for irregular time series

Usage

paleodata_interpolation(
  xin,
  interpolation_type,
  interpolation_dates,
  remove_na = TRUE,
  aggregation = TRUE,
  aggregation_fun = mean
)

Arguments

xin

Proxytibble with proxy data in 'zoo::zoo' format, or irregular time series object ('zoo::zoo'), xin can be multivariate

interpolation_type

Type of interpolation, either 'spline' (spline interpolation), or 'spectral' (using the interpolation method from Laepple and Huybers 2014, Rehfeld et al. 2018, implemented in 'PaleoSpec')

interpolation_dates

Dates of the interpolated time series

remove_na

Flag if NAs should be removed after the interpolation

aggregation

Flag if non-unique timesteps should be merged after the interpolation

aggregation_fun

Function for merging non-unique timesteps

Value

Proxytibble with interpolated proxy data in 'zoo::zoo' format or interpolated irregular time series object ('zoo::zoo')

See Also

spline (from 'stats') for spline interpolation

MakeEquidistant (from ‘PaleoSpec') for ’spectral' interpolation (optimized for computation of spectral densities from irregular time series)

Examples

# Load ice core example data
library(PTBoxProxydata)
mng <- ProxyDataManager()
icecoredata <- load_set(mng,'icecore_testset',zoo_format = 'zoo')
# Interpolate to a regular 100yr resolution between 30ka BP and 60ka BP using spline interpolation
icecoredata_interpolated <- paleodata_interpolation(icecoredata,"spline",seq(30000,60000,by=100))
# Plot datasets
plot(icecoredata_interpolated$proxy_data[[1]])
plot(icecoredata_interpolated$proxy_data[[2]])
# Interpolate to a regular 1000yr resolution between 30ka BP and 60ka BP using interpolation method from PaleoSpec package (named "spectral" because it is optimized for computation of spectral densities)
edc_data_interpolated <- paleodata_interpolation(icecoredata$proxy_data[[1]],"spectral",seq(30000,60000,by=100))
# Plot zoo data
plot(edc_data_interpolated)


paleovar/ptboxproxytools documentation built on June 9, 2025, 1:40 a.m.