exhaust_design: Exhaust all Researcher Degrees of Freedom

View source: R/exhaust_design.R

exhaust_designR Documentation

Exhaust all Researcher Degrees of Freedom

Description

Parse through a research design, iterating over all possible choices, thereby exhausting all documented researcher degrees of freedom. Provides the option for parallel processing. Returns a data frame containing the results for all choice combinations. Alternatively, you can provide a database handle. In this case, only choice combinations that are not present in the database are estimated

Usage

exhaust_design(
  d,
  start_input,
  cl = NULL,
  db_conn_func = NULL,
  db_table = "exhausted_designs",
  libs = NULL,
  export = ls(globalenv()),
  choice_df = NULL,
  weight = FALSE,
  est_by_cchoice = 10,
  verbose = FALSE
)

Arguments

d

A character vector of the research design steps function names

start_input

The input data for the first step.

cl

Either the return value of parallel::make_cluster() or the number of cores that you want the function to start. If NULL (the default) no parallel processing is used and choices are evaluated sequentially.

db_conn_func

A function that will return a DBIConnection-class object. if not NULL the data is written to this connection and choice combinations are only estimated when they are not already present in the data. If NULL (the default) the evaluated choice combinations are returned as a data frame.

db_table

A character string providing the table name to use or create under the database connection provided with conn. Ignored if conn is NULL or has exactly one table.

libs

The libraries that the design steps rely on.

export

The members of the environment that you want to export to the parallel cores. Defaults to all members of the global environment.

choice_df

A dataframe containing the design choices that should be explored. If NULL (the default), it will be created using the parameters below.

weight

Whether each step's choices should be weighted by their user assigned weights as included in the choice_type. Protocols with zero weight are excluded from the analysis. Defaults to FALSE.

est_by_cchoice

Each continuous choice will be evaluated by est_by_choice equally spaced steps, staring at valid_min and ending at valid_max.

verbose

Set to TRUE for some additional diagnostic output. Useful for large designs that take a while to process.

Details

See the vignette of the package for further details.

Value

A data frame containing results for all feasible choice permutations.

Examples

## Not run: 
  print("Sorry. No examples yet.")

## End(Not run)

joachim-gassen/rdfanalysis documentation built on Aug. 22, 2023, 5:29 p.m.