fx_default: Effex functions: Defaults for the metaframe

Description Usage Arguments Methods (by generic) Extension Mechanism Examples

Description

The fx_default-family consists of functions with a consistent interface that that sets a default value for the specified metaframe column. Their intention is an explicit standard mode which allows to concentrate on changing special cases only. fx_default itself wraps around these functions by modifying the metaframe for any number of metaframe columns. This is, of course only useful if modifications need not be applied.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## S3 method for class 'fxd_default_fxGeom_class'
fxe_default(data, mf, col, ...)

## S3 method for class 'fxd_default_fxGeom_limits'
fxe_default(data, mf, col, ...)

## S3 method for class 'fxd_default_fxGeom_trans'
fxe_default(data, mf, col, ...)

fx_default(data, columns = character(0), ..., overwrite = FALSE,
  mustWork = TRUE)

fxe_default(data, mf, col, ..., mustWork = TRUE)

## S3 method for class 'fxd_default'
fxe_default(data, mf, col, ..., mustWork = TRUE)

Arguments

data

The dataframe with a metaframe attribute

...

Parameters to give on to the methods of fxe_default()

columns

character. The columns of the metaframe that should be provided.

overwrite

logical. Should existing columns be overwritten? If TRUE might also delete columns without compatible method.

mustWork

If no compatible method is found, should the method return NULL or throw an error?

Methods (by generic)

Extension Mechanism

fx_default can be extended by adding a method to the S3 generic fxe_default. It is recommended to specify the particular method following the scheme fx_default_<column name> to make it easier to use effex default outside an entire data frame. The new method must conform to the fxd() naming mechanism where the task is "default" and the column name is the subclass.

Examples

1
2
3
4
5
6
7
8
fxe_default(data.frame(),
            new_metaframe(name = character(0)),
            col = fxd("default"),
            mustWork = FALSE)

fxe_default(data.frame(),
            new_metaframe(name = character(0)),
            col = fxd("default"))

sflippl/tectr documentation built on May 6, 2019, 8:51 a.m.