View source: R/misc_analyses.R
calc_prop_taxa_from_sample_type | R Documentation |
Calculate the mean proportion of taxa (i.e. OTUs) in a set of samples that are also observed in another sample type. One use of this function is to get a rough sense of how likely a potential source is contributing to the compostion of another sample type.
calc_prop_taxa_from_sample_type( input, type_header, primary_type, source_type, within_cat )
input |
The input dataset as loaded by |
type_header |
The header label from the metadata map that has the labels which indicate the types of samples you want to use. |
primary_type |
The sample type for which you would like to calculate
the proportion of taxa that are also observed in the |
source_type |
The sample type to use as the source type. |
within_cat |
[OPTIONAL] Specify a header label from the metadata map that tells the function to restrict pairs to within levels of this factor. If included, will return a data frame instead of a vector. |
calc_prop_shared_taxa
# proportion of taxa on strawberries that were also found on spinach calc_prop_taxa_from_sample_type( fruits_veggies, type_header = 'Sample_type', primary_type = 'Strawberries', source_type = 'Spinach' ) # proportion of taxa on strawberries that were also found on spinach within # each farming type calc_prop_taxa_from_sample_type( fruits_veggies, type_header = 'Sample_type', primary_type = 'Strawberries', source_type = 'Spinach', within_cat = 'Farm_type' )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.