addvar: Derived 1 variable and 1 function

View source: R/collectedfunctions.R

addvarR Documentation

Derived 1 variable and 1 function

Description

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

Usage

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

Arguments

dat

data frame

sort

sort derived variable by ex:"ID","SEX"

var

variable to be derived

fun

deriving function ex:"mean x"

add.to.data

if "yes" result will be appended to dat

name

column name of derived variable


leonpheng/lhtool2 documentation built on April 13, 2025, 5:42 p.m.