trans_rarefy | R Documentation |
Rarefaction based on the microtable rarefy_samples function and plotting based on the ggplot2.
new()
trans_rarefy$new(dataset = NULL, alphadiv = "Shannon", depth = NULL, ...)
dataset
the object of microtable
Class.
alphadiv
default "Shannon"; alpha diversity measurement used for the rarefaction; see microtable$cal_alphadiv for all the measurement.
depth
default NULL; an integer vecotr used for the rarefying.
...
parameters passed to rarefy_samples
function of microtable
class, except the sample.size parameter.
res_rarefy stored in the object.
\donttest{ library(microeco) data(dataset) t1 <- trans_rarefy$new(dataset = dataset, depth = c(0, 10, 50, 400, 800)) }
plot_rarefy()
Plotting the rarefied result.
trans_rarefy$plot_rarefy( color_values = RColorBrewer::brewer.pal(8, "Dark2"), color = "SampleID", show_point = TRUE, point_size = 0.3, point_alpha = 0.6, add_fitting = FALSE, x_axis_title = "Sequence number", y_axis_title = NULL, show_legend = TRUE, show_samplename = FALSE, samplename_size = 3, samplename_color = "grey30", ... )
color_values
colors used for presentation.
color
default "SampleID"; color mapping in the plot.
show_point
default TRUE; whether show the point.
point_size
default .3; point size value.
point_alpha
default .6; point alpha value.
add_fitting
default FALSE; whether add fitted line.
x_axis_title
default "Sequence number"; x axis title.
y_axis_title
default NULL; default NULL represents the measure used.
show_legend
default TRUE; whether show the legend in the plot.
show_samplename
default FALSE; whether show the sample name in the plot.
samplename_size
default 3; the sample name text size. Only available when show_samplename is TRUE.
samplename_color
default "grey70"; sample name text color. Only available when show_samplename is TRUE.
...
parameters pass to ggplot2::geom_line (when add_fitting = FALSE) or ggplot2::geom_smooth (when add_fitting = TRUE).
ggplot.
\donttest{ t1$plot_rarefy(color = "Group") }
print()
Print the trans_rarefy object.
trans_rarefy$print()
clone()
The objects of this class are cloneable with this method.
trans_rarefy$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------
## Method `trans_rarefy$new`
## ------------------------------------------------
library(microeco)
data(dataset)
t1 <- trans_rarefy$new(dataset = dataset, depth = c(0, 10, 50, 400, 800))
## ------------------------------------------------
## Method `trans_rarefy$plot_rarefy`
## ------------------------------------------------
t1$plot_rarefy(color = "Group")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.