enve.barplot {enveomics.R} | R Documentation |
Enveomics: Barplot
Description
Creates nice barplots from tab-delimited tables.
Usage
enve.barplot(
x,
sizes,
top = 25,
colors.per.group = 9,
bars.width = 4,
legend.ncol = 1,
other.col = "#000000",
add.trend = FALSE,
organic.trend = FALSE,
sort.by = median,
min.report = 101,
order = NULL,
col,
...
)
Arguments
x |
Can be either the input data or the path to the file containing the table.
|
sizes |
A numeric vector containing the real size of the samples (columns) in the same order of the input table. If set, the values are assumed to be 100%. Otherwise, the sum of the columns is used. |
top |
Maximum number of categories to display. Any additional categories will be listed as "Others". |
colors.per.group |
Number of categories in the first two saturation groups of colors. The third group contains the remaining categories if needed. |
bars.width |
Width of the barplot with respect to the legend. |
legend.ncol |
Number of columns in the legend. |
other.col |
Color of the "Others" category. |
add.trend |
Controls if semi-transparent areas are to be plotted between the bars to connect the regions (trend regions). |
organic.trend |
Controls if the trend regions are to be smoothed
(curves). By default, trend regions have straight edges. If |
sort.by |
Any function that takes a numeric vector and returns a
numeric scalar. This function is applied to each row, and the resulting
values are used to sort the rows (decreasingly). Good options include:
|
min.report |
Minimum percentage to report the value in the plot. Any value above 100 indicates that no values are to be reported. |
order |
Controls how the rows should be ordered.
|
col |
Colors to use. If provided, overrides the variables |
... |
Any additional parameters to be passed to barplot. |
Value
No return value
Author(s)
Luis M. Rodriguez-R [aut, cre]
Examples
# Load data
data("phyla.counts", package = "enveomics.R", envir = environment())
# Create a barplot sorted by variance with organic trends
enve.barplot(
phyla.counts, # Counts of phyla in four sites
sizes = c(250,100,75,200), # Total sizes of the datasets of each site
bars.width = 2, # Decrease from default, so the names are fully displayed
organic.trend = TRUE, # Nice curvy background
sort.by = var # Sort by variance across sites
)