Public methods
Method new()
Usage
trans_beta$new(dataset = NULL, measure = NULL, group = NULL)
Arguments
- dataset
- the object of - microtableClass.
 
measuredefault NULL; bray, jaccard, wei_unifrac or unwei_unifrac, or other name of matrix you add; 
beta diversity index used for ordination, manova or group distance.
groupdefault NULL; sample group used for manova, betadisper or group distance.
Returns
parameters stored in the object.
Examples
data(dataset)
t1 <- trans_beta$new(dataset = dataset, measure = "bray", group = "Group")
Method cal_ordination()
Ordination based on An et al. (2019) <doi:10.1016/j.geoderma.2018.09.035>.
Usage
trans_beta$cal_ordination(
  ordination = "PCoA",
  ncomp = 3,
  trans_otu = FALSE,
  scale_species = FALSE
)
Arguments
- ordination
- default "PCoA"; "PCA", "PCoA" or "NMDS". 
ncompdefault 3; the returned dimensions.
trans_otudefault FALSE; whether species abundance will be square transformed, used for PCA.
scale_speciesdefault FALSE; whether species loading in PCA will be scaled.
Returns
res_ordination stored in the object.
Examples
t1$cal_ordination(ordination = "PCoA")		
Method plot_ordination()
Plotting the ordination result based on An et al. (2019) <doi:10.1016/j.geoderma.2018.09.035>.
Usage
trans_beta$plot_ordination(
  color_values = RColorBrewer::brewer.pal(8, "Dark2"),
  shape_values = c(16, 17, 7, 8, 15, 18, 11, 10, 12, 13, 9, 3, 4, 0, 1, 2, 14),
  plot_color = NULL,
  plot_shape = NULL,
  plot_group_order = NULL,
  plot_point_size = 3,
  plot_point_alpha = 0.9,
  plot_sample_label = NULL,
  plot_group_centroid = FALSE,
  plot_group = NULL,
  segment_alpha = 0.6,
  centroid_linetype = 3,
  plot_group_ellipse = FALSE,
  ellipse_level = 0.9,
  ellipse_alpha = 0.1,
  ellipse_type = "t"
)
Arguments
- color_values
- default RColorBrewer::brewer.pal(8, "Dark2"); colors for presentation. 
shape_valuesdefault c(16, 17, 7, 8, 15, 18, 11, 10, 12, 13, 9, 3, 4, 0, 1, 2, 14); a vector used in the shape type, see ggplot2 tutorial.
plot_colordefault NULL; the sample group name used for color in plot.
plot_shapedefault NULL; the sample group name used for shape in plot.
plot_group_orderdefault NULL; a vector used to order the groups in the legend of plot.
plot_point_sizedefault 3; point size in plot.
plot_point_alphadefault .9; point transparency in plot.
plot_sample_labeldefault NULL; the column name in sample table, if provided, show the point name in plot.
plot_group_centroiddefault FALSE; whether show the centroid in each group of plot.
plot_groupdefault NULL; the column name in sample table, generally used with plot_group_centroid and plot_group_ellipse.
segment_alphadefault .6; segment transparency in plot.
centroid_linetypedefault 3; the line type related with centroid in plot.
plot_group_ellipsedefault FALSE; whether show the confidence ellipse in each group of plot.
ellipse_leveldefault .9; confidence level of ellipse.
ellipse_alphadefault .1; color transparency in the ellipse.
ellipse_typedefault t; see type in stat_ellipse.
Returns
ggplot.
Examples
t1$plot_ordination(plot_color = "Group", plot_shape = "Group", plot_group_ellipse = TRUE)
Method cal_manova()
Calculate perMANOVA based on Anderson al. (2008) <doi:10.1111/j.1442-9993.2001.01070.pp.x> and R vegan adonis function.
Usage
trans_beta$cal_manova(
  cal_manova_all = FALSE,
  cal_manova_paired = FALSE,
  cal_manova_set = NULL,
  permutations = 999
)
Arguments
- cal_manova_all
- default FALSE; whether manova is used for all data. 
cal_manova_paireddefault FALSE; whether manova is used for all the paired groups.
cal_manova_setdefault NULL; specified group set for manova, see adonis.
permutationsdefault 999; see permutations in adonis.
Returns
res_manova stored in object.
Examples
t1$cal_manova(cal_manova_all = TRUE)
Method cal_betadisper()
A wrapper for betadisper function in vegan package for multivariate homogeneity test of groups dispersions.
Usage
trans_beta$cal_betadisper(...)
Arguments
- ...
- parameters passed to - betadisperfunction.
 
Returns
res_betadisper stored in object.
Examples
t1$cal_betadisper()
Method cal_group_distance()
Transform sample distances within groups or between groups.
Usage
trans_beta$cal_group_distance(within_group = TRUE)
Arguments
- within_group
- default TRUE; whether transform sample distance within groups, if FALSE, transform sample distance between any two groups. 
Returns
res_group_distance stored in object.
Examples
\donttest{
t1$cal_group_distance(within_group = TRUE)
}
Method plot_group_distance()
Plotting the distance between samples within or between groups.
Usage
trans_beta$plot_group_distance(
  plot_group_order = NULL,
  color_values = RColorBrewer::brewer.pal(8, "Dark2"),
  distance_pair_stat = FALSE,
  pair_compare_filter = "",
  pair_compare_method = "wilcox.test",
  plot_distance_xtype = NULL
)
Arguments
- plot_group_order
- default NULL; a vector used to order the groups in the plot. 
color_valuescolors for presentation.
distance_pair_statdefault FALSE; whether do the paired comparisions.
pair_compare_filterdefault ""; if provided, remove the matched groups.
pair_compare_methoddefault wilcox.test; wilcox.test, kruskal.test, t.test or anova.
plot_distance_xtypedefault NULL; number used to make x axis text generate angle.
Returns
ggplot.
Examples
\donttest{
t1$plot_group_distance(distance_pair_stat = TRUE)
}
Method plot_clustering()
Plotting clustering result. Require ggdendro package.
Usage
trans_beta$plot_clustering(
  use_colors = RColorBrewer::brewer.pal(8, "Dark2"),
  measure = NULL,
  group = NULL,
  replace_name = NULL
)
Arguments
- use_colors
- colors for presentation. 
measuredefault NULL; beta diversity index; If NULL, using the measure when creating object
groupdefault NULL; if provided, use this group to assign color.
replace_namedefault NULL; if provided, use this as label.
Returns
ggplot.
Examples
t1$plot_clustering(group = "Group", replace_name = c("Saline", "Type"))
Method print()
Print the trans_beta object.
Usage
trans_beta$print()
Method clone()
The objects of this class are cloneable with this method.
Usage
trans_beta$clone(deep = FALSE)
Arguments
- deep
- Whether to make a deep clone.