Learn R Programming

perry (version 0.3.1)

perry-deprecated: Deprecated functions in package perry

Description

These functions are provided for compatibility with older versions only, and may be defunct as soon as the next release.

Usage

# S3 method for perry
fortify(
  model,
  data,
  select = NULL,
  reps = model$splits$R > 1,
  seFactor = NA,
  ...
)

# S3 method for perrySelect fortify( model, data, subset = NULL, select = NULL, reps = model$splits$R > 1, seFactor = model$seFactor, ... )

# S3 method for perryTuning fortify(model, data, ...)

# S3 method for default perryPlot( object, method = c("box", "density", "dot", "line"), mapping, facets = attr(object, "facets"), ... )

Arguments

model

an object inheriting from class "perry" or "perrySelect" that contains prediction error results.

data

currently ignored.

select

a character, integer or logical vector indicating the columns of prediction error results to be converted.

reps

a logical indicating whether to convert the results from all replications (TRUE) or the aggregated results (FALSE). The former is suitable for box plots or smooth density plots, while the latter is suitable for dot plots or line plots (see perryPlot).

seFactor

a numeric value giving the multiplication factor of the standard error for displaying error bars in dot plots or line plots. Error bars in those plots can be suppressed by setting this to NA.

for the "perryTuning" method of fortify, additional arguments to be passed down to its "perrySelect" method. For the other methods of fortify, additional arguments are currently ignored. For the default method of perryPlot, additional arguments to be passed down to geom_boxplot, geom_density, geom_pointrange or geom_line.

subset

a character, integer or logical vector indicating the subset of models to be converted.

object

an object inheriting from class "perry" or "perrySelect" that contains prediction error results, or a data frame containing all necessary information for plotting (as generated by the corresponding fortify method).

method

a character string specifying the type of plot. Possible values are "box" to create a box plot, "density" to create a smooth density plot, "dot" to create a dot plot, or "line" to plot the (average) results for each model as a connected line (for objects inheriting from class "perrySelect"). Note that the first two plots are only meaningful in case of repeated resampling. The default is to use "box" in case of repeated resampling and "dot" otherwise. In any case, partial string matching allows supply abbreviations of the accepted values.

mapping

an aesthetic mapping to override the default behavior (see aes or aes_string).

facets

a faceting formula to override the default behavior. If supplied, facet_wrap or facet_grid is called depending on whether the formula is one-sided or two-sided.

Value

The fortify methods return a data frame containing the columns listed below, as well as additional information stored in the attribute "facets" (default faceting formula for the plots).

Fit

a vector or factor containing the identifiers of the models.

Name

a factor containing the names of the predictor error results (not returned in case of only one column of prediction error results with the default name).

PE

the estimated prediction errors.

Lower

the lower end points of the error bars (only returned if reps is FALSE).

Upper

the upper end points of the error bars (only returned if reps is FALSE).

Details

The fortify methods extract all necessary information for plotting from resampling-based prediction error results and store it in a data frame.

The default method of perryPlot creates the corresponding plot from the data frame returned by fortify.