append_mfData: Append two compatible multivariate 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 multivariate functional observations of two datasets to a unique multivariate functional dataset.

Usage

1
append_mfData(mfD1, mfD2)

Arguments

mfD1

is the first multivariate functional dataset, stored into an mfData object.

mfD2

is the second multivariate functional dataset, stored into an mfData object.

Details

The two original datasets must be compatible, i.e. must have same number of components (dimensions) and must be defined on the same grid. If we denote with X_1^(i), …, X_n^(i), i=0, …, L the first dataset, defined over the grid I = t_1, …, t_P, and with Y_1^(i), …, Y_m^(i), i=0, …, L the second functional dataset, the method returns the union dataset obtained by taking all the n + m observations together.

Value

The function returns a mfData object containing the union of mfD1 and mfD2

See Also

append_fData, mfData

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Creating two simple bivariate datasets

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

values11 = matrix( c(sin(grid),
                     sin(2 * grid)), nrow = 2, ncol = length(grid),
                   byrow=TRUE)
values12 = matrix( c(sin(3 * grid),
                     sin(4 * grid)), nrow = 2, ncol = length(grid),
                   byrow=TRUE)
values21 = matrix( c(cos(grid),
                     cos(2 * grid)), nrow = 2, ncol = length(grid),
                   byrow=TRUE)
values22 = matrix( c(cos(3 * grid),
                     cos(4 * grid)), nrow = 2, ncol = length(grid),
                   byrow=TRUE)

mfD1 = mfData( grid, list(values11, values12) )
mfD2 = mfData( grid, list(values21, values22) )

# Appending them to a unique dataset
append_mfData(mfD1, mfD2)

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