create_enrichwith_skeleton: Create a enrichwith skeleton

Description Usage Arguments Value

View source: R/create_enrichwith_skeleton.R

Description

Create an enrichwith skeleton file for the structured implementation of methods to compute new components for objects of a specific class

Usage

1
2
create_enrichwith_skeleton(class, option, description, component, path,
  filename = paste0(class, "_options.R"), attempt_rename = TRUE)

Arguments

class

the class of the objects to be enriched

option

a character vector with components the enrichment options

description

a character vector of length length(options) with components the description of the enrichment options

component

a list of as many character vectors as length(option), specifying the names of the components that each option will add to the object after enrichment

path

the path where the skeleton file will be created

filename

the name of the skeleton file

attempt_rename

attempt to rename syntactically incorrect component names? Default is TRUE

Value

A file with the necessary functions to use enrichwith infrastructure. The skeleton consists of the following functions

  • One compute_component.class function per component name from unique(unlist(component)). The function takes as input the object to be enriched and returns as output the component to be added to the object.

  • The get_enrichment_options.class function, that takes as input the object to be enriched and an enrichment option, and returns the names of the components that will be appended to the object for this option. This function can also be used to list the available options and print their description.

  • The enrich.class function


enrichwith documentation built on May 19, 2017, 10:40 a.m.

Search within the enrichwith package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.