Learn R Programming

GET (version 0.1-8)

create_curve_set: Create a curve set

Description

Create a curve set out of a list in the right form.

Usage

create_curve_set(curve_set, ...)

Arguments

curve_set

A list containing the element obs, and optionally the elements r, sim_m and theo. See details.

...

For expert use only.

Value

An object of class curve_set.

Details

obs must be either

  • a vector containing the data function, or

  • a matrix containing the s data functions, in which case it is assumed that each column corresponds to a data function.

If given, r describes the 1- or 2-dimensional argument values where the curves have been observed (or simulated). It must be either

  • a vector,

  • a data.frame with columns "x", "y", "width" and "height", where the width and height give the width and height of the pixels placed at x and y, or

  • a data.frame with columns "xmin", "xmax", "ymin" and "ymax" giving the corner coordinates of the pixels where the data have been observed.

If obs is a vector, sim_m must be a matrix containing the simulated functions. Each column is assumed to correspond to a function, and the number of rows must match the length of obs. If obs is a matrix, sim_m is ignored.

If obs is a vector, theo can be given and it should then correspond to a theoretical function (e.g., under the null hypothesis). If present, its length must match the length of obs.

Examples

Run this code
# NOT RUN {
# 1d
cset <- create_curve_set(list(r=1:10, obs=matrix(runif(10*5), ncol=5)))
plot(cset)
# 2d
cset <- create_curve_set(list(r=data.frame(x=c(rep(1:3, 3), 4), y=c(rep(1:3, each=3), 1),
                                           width=1, height=1),
                              obs=matrix(runif(10*5), ncol=5)))
plot(cset)
# }

Run the code above in your browser using DataLab