paleodata_spectrum: Function to compute spectra (raw and smoothed using...

View source: R/Proxytools_tools.R

paleodata_spectrumR Documentation

Function to compute spectra (raw and smoothed using log-smooth) following the multi-taper methodology applied in Laepple and Huybers 2014, Rehfeld et al. 2018

Description

Function to compute spectra (raw and smoothed using log-smooth) following the multi-taper methodology applied in Laepple and Huybers 2014, Rehfeld et al. 2018

Usage

paleodata_spectrum(
  xin,
  interpolation = TRUE,
  interpolation_type = "spectral",
  interpolation_dates = NULL,
  transformation = FALSE,
  transformation_type = "normalize",
  detrend = TRUE,
  df_log = 0.05,
  bLog = FALSE
)

Arguments

xin

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

interpolation

Logical: should interpolation be applied?

interpolation_type

Parameters for interpolation (see paleodata_interpolation)

interpolation_dates

Parameters for interpolation (see paleodata_interpolation). If NULL the interpolation is set to the mean temporal resolution of each proxy time series.

transformation

Logical: should transformation be applied?

transformation_type

Parameters for transformation (see paleodata_transformation)

detrend

Logical: should time series be linearly detrend before computing the spectrum

df_log

Width of the log-smoother in log units

bLog

TRUE: average in the log space of the power, FALSE: arithmetic average

Value

List with raw and log-smoothed spectra (object description in SpecMTM and LogSmooth functions of PaleoSpec package)

See Also

paleodata_interpolation (from 'PTBoxProxytools') for interpolation to regular time axis

paleodata_transformation (from 'PTBoxProxytools') for time series transformation

SpecMTM (from 'PaleoSpec') for computation of spectrum with multi-taper methodology

LogSmooth (from 'PaleoSpec') for log smoothing of spectrum

Examples

# Load ice core example data
library(PTBoxProxydata)
library(PaleoSpec)
mng <- ProxyDataManager()
icecoredata <- load_set(mng,'icecore_testset',zoo_format = 'zoo')
# First compute spectra
testout <- icecoredata$proxy_data[[1]] %>% paleodata_spectrum(.)
# Second plot spectra (output is list with raw and log-smoothed spectra that can be plotted using PaleoSpec())
PaleoSpec::LPlot(testout$raw)
PaleoSpec::LLines(testout$logsmooth)


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