Learn R Programming

GET (version 0.1-5)

fBoxplot: Functional boxplot

Description

Functional boxplot based on central region computed by a specified measure. The options of the measures can be found in central_region.

Usage

fBoxplot(curve_sets, factor = 1.5, ...)

Arguments

curve_sets

A curve_set object or a list of curve_set objects.

factor

The constant factor to inflate the central region to produce a functional boxplot and determine fences for outliers. Default is 1.5 as in a classical boxplot.

...

Additional parameters to be passed to central_region, which is responsible for calculating the central region (global envelope) on which the functional boxplot is based.

Examples

Run this code
# NOT RUN {
if(requireNamespace("fda", quietly=TRUE)) {
  years <- paste(1:18)
  curves <- fda::growth[['hgtf']][years,]
  # Heights
  cset1 <- create_curve_set(list(r = as.numeric(years),
                                 obs = curves))
  plot(cset1, ylab="Height")
  bp <- fBoxplot(cset1, coverage=0.50, type="area", factor=1)
  plot(bp)

  # Considering simultaneously heights and height differences
  cset2 <- create_curve_set(list(r = as.numeric(years[-1]),
             obs = curves[-1,] - curves[-nrow(curves),]))
  csets <- list(Height = cset1, Change = cset2)
  res <- fBoxplot(csets, type = 'area', factor = 1.5)
  plot(res, xlab = "Age (years)", ylab = "")
}
# }

Run the code above in your browser using DataLab