srce: Add source information to environment to present in...

View source: R/utils.R

srceR Documentation

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")

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)

Value

no return value, called for side effects

Author(s)

Richard Hooijmaijers

Examples

# 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

amp.dm documentation built on March 13, 2026, 5:08 p.m.