Learn R Programming

ddalpha (version 1.3.16)

dataf.growth: Berkeley Growth Study Data

Description

The data set contains the heights of 39 boys and 54 girls from age 1 to 18 and the ages at which they were collected.

Usage

dataf.growth()

Arguments

Format

The functional data as a data structure.

dataf

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

args

age - a numeric vector of length 31 giving the ages at which the heights were measured

vals

height - a numeric vector of heights in centimeters of 39 boys and 54 girls

labels

The classes of the objects: boy, girl

Details

The ages are not equally spaced.

See Also

dataf.* for other functional data sets

plot.functional for building plots of functional data

Examples

Run this code
## load the Growth dataset
dataf = dataf.growth()

## view the classes
unique(dataf$labels)

## access the 5th point of the 2nd object
dataf$dataf[[2]]$args[5]
dataf$dataf[[2]]$vals[5]

## plot the data
if (FALSE) {
  labels = unlist(dataf$labels)
  plot(dataf, 
    main = paste("Growth: girls red (", sum(labels == "girl"), "),", 
                      " boys blue (", sum(labels == "boy"), ")", sep=""),
    xlab="Year", ylab="Height, cm",
    colors = c("blue", "red")   # in alphabetical order of class labels   
    )
}

Run the code above in your browser using DataLab