Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nObsPoints

Get the number of observation points


Description

This functions returns the number of observation points in an object of class funData, multiFunData or irregFunData.

Usage

nObsPoints(object)

Arguments

object

An object of class funData, multiFunData or irregFunData.

Details

Depending on the class of object, the function returns different values:

  • If object is of class funData, the function returns a vector of length dimSupp(object), giving the number of observations in each dimension.

  • If object is of class multiFunData, the function returns a list of the same length as object, where the j-th entry is a vector, corresponding to the observations point of object[[j]].

  • If object is of class irregFunData, the function returns an array of length nObs(object), where the j-th entry corresponds to the number of observations in the j-th observed function.

Value

The number of observation points in object. See Details.

Warning

Do not confound with nObs, which returns the number of observations (i.e. the number of observed functions) in an object of a functional data class.

See Also

Examples

# Univariate (one-dimensional)
object1 <- funData(argvals = 1:5, X = rbind(1:5, 6:10))
nObsPoints(object1)

# Univariate (two-dimensional)
object2 <- funData(argvals = list(1:5, 1:6), X = array(1:60, dim = c(2, 5, 6)))
nObsPoints(object2)

# Multivariate
multiObject <- multiFunData(object1, object2)
nObsPoints(multiObject)

# Univariate (irregular)
irregObject <- irregFunData(argvals = list(1:5, 2:4), X = list(2:6, 3:5))
nObsPoints(irregObject)

funData

An S4 Class for Functional Data

v1.3-5
GPL-2
Authors
Clara Happ-Kurz [aut, cre]
Initial release
2020-04-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.