renaming_fa: Rename fatty acid variables from PROMISE into scientific...

Description Usage Arguments Value Functions Examples

View source: R/renaming_fattyacids.R

Description

Fatty acids in the PROMISE cohort are in the form e.g. ne160. In the typical data analysis pipeline, these variables may be converted into a long format such that these variables are now rows in a column. These variables will likely end up in plot, so it's necessary to convert them into the appropriate scientific format (e.g. NE 16:0, or such simply 16:0).

Usage

1
2
3
renaming_fa(fa, keep.fraction = TRUE)

extract_fa_fraction(x, uppercase = FALSE)

Arguments

keep.fraction

Logical. Whether to keep the fraction abbreviation as a prefix.

x

Vector (or column when through dplyr::mutate) of the original fatty acid names.

uppercase

Logical. Whether to convert the fraction abbreviation to upper case.

Value

Reformatted fatty acid names to be scientifically accurate.

Functions

Examples

1
2
3
4
5
fattyacids <- c("ne160", "tg141n7", "TotalTG")
renaming_fa(fattyacids)
renaming_fa(fattyacids, keep.fraction = FALSE)
extract_fa_fraction(fattyacids)
extract_fa_fraction(fattyacids, uppercase = TRUE)

lwjohnst86/PROMISE.misc documentation built on May 21, 2019, 1:44 p.m.