dataf: Converts data from fdata class to the functional class.

Description Usage Arguments Format See Also Examples

View source: R/dataf.r

Description

fda.usc contains a handy function fdata that converts varios types of functional data to the fdata class. To use these data in ddalphaf.train it must first be converted with dataf.

The function may be used either to convert a fdata object that contains multiple classes, or to convert multiple fdata objects, each of which contains one class.

Note that fdata$fdata2d = TRUE is not supported.

Usage

1
dataf(fdatas, labels) 

Arguments

fdatas

an fdata object with curves belonging to multiple classes, or a list of fdata objects, each of which contains curves of the same class

labels

a list of labels of the functional observations. If fdatas is a single fdata object, the list contains labels for each curve. If fdatas is a list of fdata objects, the list labels for each of these fdata objects.

Format

The functional data as a data structure (see dataf.*).

dataf

The functional data as a list of objects. Each object is characterized by two coordinates

args

The arguments vector

vals

The values vector

labels

The classes of the objects

See Also

dataf.* for the functional data format.

ddalphaf.train to train the functional DDα-classifier

compclassf.train to train the functional componentwise classifier

plot.functional for building plots of functional data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
library(fda.usc)
data(phoneme)

# 1. convert a fdata object that contains multiple classes.
#    labels are defined for each curve
converted = dataf(phoneme$learn, phoneme$classlearn)
plot.functional(converted)

# 2. convert multiple fdata objects, each of which contains one class
#    the same label is applied to all curves of each fdata object
converted = dataf(list(phoneme$learn, phoneme$test), c("1 red", "2 blue"))
converted$name = "Phoneme learn (red) and test (blue)"
plot.functional(converted)

## End(Not run)

ddalpha documentation built on Jan. 9, 2020, 5:09 p.m.