Generates a timeseries plot showing relative read abundances over time.
amp_timeseries( data, time_variable = NULL, group_by = NULL, tax_aggregate = "OTU", tax_add = NULL, tax_show = 5, tax_class = NULL, tax_empty = "best", split = FALSE, scales = "free_y", normalise = TRUE, plotly = FALSE, ... )
(required) Data list as loaded with
(required) The name of the column in the metadata containing the time variables, e.g.
Group the samples by a variable in the metadata.
The taxonomic level to aggregate the OTUs. (default:
Additional taxonomic level(s) to display, e.g.
The number of taxa to show, or a vector of taxa names. (default:
Converts a specific phylum to class level instead, e.g.
How to show OTUs without taxonomic information. One of the following:
Split the plot into subplots of each taxa. (default:
(logical) Transform the OTU read counts to be in percent per sample. (default:
(logical) Returns an interactive plot instead. (default:
Additional arguments passed to
A ggplot2 object.
Julie Klessner Thun Pedersen firstname.lastname@example.org
Kasper Skytte Andersen email@example.com
# Load example data data("AalborgWWTPs") # Timeseries of the 5 most abundant OTUs based on the "Date" column amp_timeseries(AalborgWWTPs, time_variable = "Date", tax_aggregate = "OTU" )#> Warning: Duplicate dates in column Date, displaying the average for each date. #> Consider grouping dates using the group_by argument or subset the data using amp_subset_samples.#> Warning: `group_by_()` is deprecated as of dplyr 0.7.0. #> Please use `group_by()` instead. #> See vignette('programming') for more help #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_warnings()` to see where this warning was generated.# As the above warning suggests, there are more than one sample per date in the data, # in this case one from Aalborg East and one from Aalborg West. The average of the # two samples is then shown per date. In such case it is then recommended to either # subset the data, or group the samples by setting group_by = "" and split by tax_aggregate # by setting split = TRUE: amp_timeseries(AalborgWWTPs, time_variable = "Date", group_by = "Plant", split = TRUE, scales = "free_y", tax_show = 9, tax_aggregate = "Genus", tax_add = "Phylum" )