apply.fdsample: Apply summary function to the y-values in an fdsample

Description Usage Arguments Details Examples

View source: R/apply-generic.R

Description

Applies a function to the curves function values (y-values) in an fdsample object, for each argument value (x-value).

Usage

1
apply.fdsample(x, fun = mean, ..., fopt = list())

Arguments

x

object of type fdsample

fun

the function to apply, defaults to the mean

...

optional, (plot) options for updating options element of the result

fopt

list of options to fun

Details

The function fun should return a single number or a vector of fixed length. This is not checked.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(exampledata)
# look at data set fuda
str(fuda)
# apply the summary function contained in fuda$options
str(apply.fdsample(fuda))
# apply the median
str(apply.fdsample(fuda, "median"))
# apply median and change axis label
str(apply.fdsample(fuda, median, xlab = "median of y-values"))
# another way to get the median and change axis label
str(apply.fdsample(fuda, quantile, list(prob = 0.5), xlab = "50% quantile of y-values"))

fdnonpar documentation built on May 2, 2019, 5:54 p.m.