highAndLow-methods: Function to convert continuous exposures to categorical...

Description Usage Arguments Value See Also Examples

Description

This method allows to convert continuous exposures of an ExposomeSet to categorical exposures using the n-percentile groups, defined by ngroups argument. By default, all levels are kept but if intervals is set to "extrem", the levels between the extrems (aka. lowes and highest) are discarted and their values set to NA.

Usage

1
2
3
4
5
6
7
8
highAndLow(
  object,
  ngroups = 3,
  intervals = "standard",
  select,
  drop = FALSE,
  warnings = TRUE
)

Arguments

object

An object of class ExposomeSet.

ngroups

(default 3) Number of intervals to be created.

intervals

(default "standard") If set to "sctandard" all levels are set. If set to "extreme" obly lowes and highest levels are kept (others are set to NA).

select

(optional) Subset of exposures where the discretization is applied. If missing, all exposures are used.

drop

(default FALSE) If set to FALSE original exposures are kept and discretized exposures are add to ExposomeSet. If set to TRUE, original exposures are replaced by categorical exposures.

warnings

(defaulr TRUE) If set to FALSE warnings are not shown.

Value

A new ExposomeSet with categorical exposures.

See Also

trans to transform exposures, standardize to standardize exposures.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# No drop
data("exposome")
exp.hl <- highAndLow(expo, intervals = "standard", select = "ldde_lip")
dim(exp.hl)
# exposures   samples phenotyes
#       105      1200         4
dim(expo)
# exposures   samples phenotyes
#       104      1200         4
# exps.hl has 107 exposures: the original 104 plus the new
#         3 factored exposures

# Drop
exp.hl <- highAndLow(expo, intervals = "standard",
    select = "ldde_lip", drop = TRUE)
dim(exp.hl)
# exposures   samples phenotyes
#       104      1200         4
dim(expo)
# exposures   samples phenotyes
#       104      1200         4

rexposome documentation built on March 13, 2021, 2:01 a.m.