setArgs: Set arguments and parameters to control functions and data...

View source: R/setArgs.R

setArgsR Documentation

Set arguments and parameters to control functions and data transformations.

Description

A function that collects and stores various arguments that can be used as inputs to other functions. The setArgs function comes with default parameter values for the arguments. The user is asked to check these values and understand how these will affect the data.

Usage

setArgs(
  Years = c(2000:2025),
  Age = list(All = c(0, 100)),
  AgeCat = NULL,
  AgeBy = 5,
  nSim = 1,
  imputeMethod = imputeRandomPoint,
  aname = "filename",
  mcores = 1,
  setFun = identity,
  addVars = identity,
  MoreArgs = NULL
)

Arguments

Years

numeric vector of years.

Age

list of ages as in list(Fem=c(15, 49), Mal=c(15, 54).

AgeCat

numeric vector of age categories, e.g. seq(15, 55, by=5).

AgeBy

integer value for size age categories.

nSim

number of simulations to perform.

imputeMethod

select either imputeRandomPoint or imputeMidPoint.

aname

String to name an object or set a filename.

mcores

number of cores to use for parallel package (used in MIdata). This is not available for Windows users apparently.

setFun

a function used by setData by which the data can be further subset.

addVars

a function used by setData by which additional variables can be added.

MoreArgs

a list, which adds more arguments if needed.

Value

list

Examples

# Check default parameter values
Args = setArgs()
Args 
# Set specific age and year ranges 
Args <- setArgs(Years=c(2008:2018), Age=list(Mal=c(15, 54), Fem=c(15, 49)))
setHIV(Args)
# Keep all ages
ArgsEpi <- setArgs(Age=list(All=c(0, 100)), AgeCat=seq(0, 100, 20))
setEpisodes(ArgsEpi)

vando026/ahri documentation built on Aug. 10, 2024, 3:20 p.m.