Learn R Programming

amp.dm (version 0.2.0)

srce: Add source information to environment to present in documentation

Description

Adds the source of variables into package environment, which can be used in code chunks at the applicable locations and easily added to documentation afterwards

Usage

srce(var, source, type = "c")

Value

no return value, called for side effects

Arguments

var

unquoted string with the variable for which the source should be defined

source

unquoted strings with the source(s) used for var (see example)

type

character with the type of variable can be either 'c' (copied) or 'd' (derived)

Author

Richard Hooijmaijers

Examples

Run this code
# variable AMT copied from Dose variable in Theoph data frame
srce(AMT,Theoph.Dose)
# variable BMI derived from WEIGHT variable in wt data frame
# and HEIGHT variable in ht data frame
srce(BMI,c(wt.WEIGHT,ht.HEIGHT),'d')
get_log()$srce_nfo

Run the code above in your browser using DataLab