Learn R Programming

tidyMicro (version 1.47)

micro_alpha_reg: Linear regression on alpha diversities within a micro_set

Description

A simple wrapper to run standard linear regression though the lm function. Will only use alpha diversities distinct libraries (Lib) from the specified table as to not inflate the sample size

Usage

micro_alpha_reg(alpha_set, table, ...)

Arguments

alpha_set

A tidy_micro data set with alpha diversities calculated by alpha_div

table

OTU table of interest

...

Covariates of interest. Can include interaction terms such as Group*Age

Value

A data frame containing the model estimates for each alpha diversity

Examples

Run this code
# NOT RUN {
data(bpd_phy); data(bpd_cla); data(bpd_ord); data(bpd_fam); data(bpd_clin)

otu_tabs <- list(Phylum = bpd_phy, Class = bpd_cla,
Order = bpd_ord, Family = bpd_fam)
set <- tidy_micro(otu_tabs = otu_tabs, clinical = bpd_clin) %>%
filter(day == 7) ## Only including first week

# }
# NOT RUN {
set_fam_alpha <- set %>% alpha_div(table = "Family", min_depth = 5000, min_goods = 90)
set_fam_alpha %>% micro_alpha_reg(table = "Family", bpd1)
# }

Run the code above in your browser using DataLab