append_fData: Append two compatible univariate functional datasets

Description Usage Arguments Details Value See Also Examples

View source: R/fData.R

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

1
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, …, X_n the first dataset, defined over the grid I = t_1, …, t_P, and with Y_1, …, 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 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)

roahd documentation built on Nov. 4, 2021, 1:07 a.m.