lab: Create object lab

Description Usage Arguments Value Examples

View source: R/lab.R

Description

Create object lab

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
lab(
  file,
  id,
  age,
  sex,
  normal,
  abnormal,
  is_post = T,
  name_to_find = "LBNRIND"
)

Arguments

file

A character scalar. Path to the laboratory's reference in the excel table.

id

A column name of the subject id in the dataset, without quotes.

age

A column name of the subject age in the dataset, without quotes.

sex

A column name of the subject sex in the dataset, without quotes.

normal

A normal estimate, for example, "NORMAL".

abnormal

An abnormal estimate, for example, "ABNORMAL".

is_post

A logical scalar, default is TRUE. True is postfix, otherwise, prefix.

name_to_find

A character scalar. For search prefixes or postfixes, default is "LBNRIND".

Value

The object lab.

Examples

1
2
3
obj_lab <- lab("lab_refer.xlsx", ID, AGE, SEX, 1, 2)
obj_lab <- lab("lab_refer.xlsx", ID, AGE, SEX, "NORMAL", "ABNORMAL")
obj_lab <- lab("lab_refer.xlsx", ID, AGE, SEX, "norm", "no", FALSE)

dmtools documentation built on Nov. 9, 2020, 9:06 a.m.