View source: R/misc_analyses.R
calc_taxa_changes | R Documentation |
Calculate the change relative to controls (percent) within sample groups (blocks) on a per taxon basis.
calc_taxa_changes( ts, metadata_map, block_header, treatment_header, control_label, zero_substitute )
ts |
A taxa summary dataframe as generated by
|
metadata_map |
A metadata mapping dataframe. Usually,
|
block_header |
The header name from the metadata map that contains the block (i.e. sample group) designations. |
treatment_header |
The header name from the metadata map that contains the treatment designations including which samples are controls. |
control_label |
The designation within the |
zero_substitute |
[OPTIONAL] A value to substitute in for zeros to avoid infinite percent changes. It can be appropriate to use a lower detection limit for this value. |
# calculate the percent difference in organic from conventional for each # fruit/veggie ts = summarize_taxonomy(fruits_veggies, level = 2) ts_filt = filter_taxa_from_table(ts, filter_thresh = 0.01) calc_taxa_changes(ts_filt, fruits_veggies$map_loaded, 'Sample_type', 'Farm_type', 'Conventional')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.