| 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, ...)
datasetthe object of microtable Class.
alphadivdefault "Shannon"; alpha diversity measurement used for the rarefaction; see microtable$cal_alphadiv for all the measurement.
depthdefault 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_valuescolors used for presentation.
colordefault "SampleID"; color mapping in the plot.
show_pointdefault TRUE; whether show the point.
point_sizedefault .3; point size value.
point_alphadefault .6; point alpha value.
add_fittingdefault FALSE; whether add fitted line.
x_axis_titledefault "Sequence number"; x axis title.
y_axis_titledefault NULL; default NULL represents the measure used.
show_legenddefault TRUE; whether show the legend in the plot.
show_samplenamedefault FALSE; whether show the sample name in the plot.
samplename_sizedefault 3; the sample name text size. Only available when show_samplename is TRUE.
samplename_colordefault "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)
deepWhether 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.