append_fData {roahd}R Documentation

Append two compatible univariate functional datasets

Description

This is a convenience function that simplifies the task of appending univariate functional observations of two datasets to a unique univariate functional dataset.

Usage

append_fData(fD1, fD2)

Arguments

fD1

is the first functional dataset, stored into an fData object.

fD2

is the second functional dataset, stored into an fData object.

Details

The two original datasets must be compatible, i.e. must be defined on the same grid. If we denote with X_1, \ldots, X_n the first dataset, defined over the grid I = t_1, \ldots, t_P, and with Y_1, \ldots, Y_m the second functional dataset, defined on the same grid, the method returns the union dataset obtained by taking all the n + m observations together.

Value

The function returns an fData object containing the union of fD1 and fD2

See Also

append_mfData, fData

Examples

# Creating two simple univariate datasets

grid = seq(0, 2 * pi, length.out = 100)

values1 = matrix( c(sin(grid),
                    sin(2 * grid)), nrow = 2, ncol = length(grid),
                   byrow=TRUE)

values2 = matrix( c(cos(grid),
                    cos(2 * grid)), nrow = 2, ncol = length(grid),
                   byrow=TRUE)

fD1 = fData( grid, values1 )
fD2 = fData( grid, values2 )

# Appending them to a unique dataset
append_fData(fD1, fD2)


[Package roahd version 1.4.3 Index]