group_bmi: Body-Mass Index (BMI) Classes

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/group_bmi.R

Description

Cut BMI information to standard discrete factors.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
group_bmi(
  x,
  breaks = "standard",
  n = 10,
  labels = NULL,
  include.lowest = TRUE,
  right = FALSE,
  dig.lab = 3,
  ordered_result = FALSE
)

Arguments

x

Numeric vector (BMI)

breaks

Class break points. Either a vector of breakpoints, or one of the predefined options ("standard", "standard_truncated", "even").

n

Number of groups for the breaks = "even" option.

labels

labels for the levels of the resulting category. By default, labels are constructed using "(a,b]" interval notation. If labels = FALSE, simple integer codes are returned instead of a factor.

include.lowest

logical, indicating if an ‘x[i]’ equal to the lowest (or highest, for right = FALSE) ‘breaks’ value should be included.

right

logical, indicating if the intervals should be closed on the right (and open on the left) or vice versa.

dig.lab

integer which is used when labels are not given. It determines the number of digits used in formatting the break numbers.

ordered_result

logical: should the result be an ordered factor?

Details

Regarding the breaks arguments, the "even" option aims to cut the samples in groups with approximately the same size (by quantiles). The "standard" option corresponds to standard obesity categories defined by the cutoffs <18.5 (underweight); <25 (lean); <30 (obese); <35 (severe obese); <40 (morbid obese); <45 (super obese). The standard_truncated combines the severe, morbid and super obese into a single group.

Value

Factor of BMI groups.

Author(s)

Contact: Leo Lahti microbiome-admin@googlegroups.com

References

See citation('microbiome')

See Also

base::cut

Examples

1
2
bmi.numeric <- range(rnorm(100, mean = 25, sd = 3))
bmi.factor <- group_bmi(bmi.numeric)

microbiome documentation built on Nov. 8, 2020, 5:08 p.m.