create_enrichwith_skeleton: Create a enrichwith skeleton

Description Usage Arguments Value Examples

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
# Set the directory where the skeleton is placed
my_path <- "~/Downloads"
# This is the call that created the enrichment skeleton for glms
# that ships with the package
create_enrichwith_skeleton(class = "glm",
      option = c("auxiliary functions", "score vector",
       "mle of dispersion", "expected information",
       "observed information", "first-order bias"),
      description = c("various likelihood-based quantities
        (gradient of the log-likelihood, expected and observed
        information matrix and first term in the expansion of
        the bias of the mle) and a simulate method as functions
        of the model parameters",
       "gradient of the log-likelihood at the mle",
       "mle of the dispersion parameter",
       "expected information matrix evaluated at the mle",
       "observed information matrix evaluated at the mle",
       "first term in the expansion of the bias of the mle
        at the mle"),
      component = list("auxiliary_functions", "score_mle",
                       "dispersion_mle",
                       "expected_information_mle",
                       "observed_information_mle",
                       "bias_mle"),
      path = my_path,
      attempt_rename = FALSE)


## End(Not run)

enrichwith documentation built on Jan. 11, 2020, 9:21 a.m.