addvar: Derived 1 variable and 1 function

Description Usage Arguments Examples

View source: R/collectedfunctions.R

Description

This function allows you to add derived variable (ex: add mean value by ID).

Usage

1
addvar(dat, sort, var, fun, add.to.data = "yes", name = NULL)

Arguments

dat

data frame

sort

sort derived variable by (ex:c("ID","SEX"))

var

variable to be derived

fun

deriving funtion ex:"mean(x)")

add.to.data

if "yes" result will be appended to dat

name

column name of derived variable

Examples

1

leonpheng/lhtool documentation built on Dec. 16, 2019, 3:52 a.m.