View source: R/alignTimeSeries.R
| alignTimeSeries | R Documentation |
Aligns multiple time series datasets to a common temporal resolution using LOESS interpolation and joins them into a single dataframe. This is useful when combining datasets with different sampling intervals.
alignTimeSeries(
datasets.list = NULL,
time.column = NULL,
interpolation.interval = NULL
)
mergePalaeoData(
datasets.list = NULL,
time.column = NULL,
interpolation.interval = NULL
)
datasets.list |
list of dataframes, as in |
time.column |
character string, name of the time column of the datasets provided in |
interpolation.interval |
numeric, temporal resolution of the output data, in the same units as the time columns of the input data. Default: |
This function fits a loess model of the form y ~ x, where y is any numeric column in the input datasets and x is the column given by the time.column argument. The model is used to interpolate column y on a regular time series of intervals equal to interpolation.interval. All numeric columns in every provided dataset go through this process to generate the final data with samples separated by regular time intervals. Non-numeric columns are ignored and absent from the output dataframe.
A dataframe with every column of the initial dataset interpolated to a regular time grid of resolution defined by interpolation.interval. Column names follow the form datasetName.columnName, so the origin of columns can be tracked.
Blas M. Benito <blasbenito@gmail.com>
Other data_preparation:
lagTimeSeries()
#loading data
data(pollen)
data(climate)
x <- alignTimeSeries(
datasets.list = list(
pollen=pollen,
climate=climate
),
time.column = "age",
interpolation.interval = 0.2
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.