Learn R Programming

RAM (version 1.2.1.3)

dissim.plot: Plot Dissimilarity Matrix Data for Different Methods

Description

These functions all produce a plot of some measure related to dissimilarity matrices. All of these functions allow you to specify a vector of methods to be used when creating the plot.

Usage

dissim.clust.plot(data, is.OTU=TRUE, stand.method=NULL, dist.methods=NULL, clust.methods=NULL, file=NULL) dissim.eig.plot(data, is.OTU=TRUE, stand.method=NULL, dist.methods=NULL, file=NULL) dissim.alleig.plot(data, is.OTU=TRUE, stand.method=NULL, dist.methods=NULL, file=NULL) dissim.ord.plot(data, is.OTU=TRUE, stand.method=NULL, dist.methods=NULL, k=NULL, file=NULL) dissim.GOF.plot(data, is.OTU=TRUE, stand.method=NULL, dist.methods=NULL, file=NULL) dissim.tree.plot(data, is.OTU=TRUE, stand.method=NULL, dist.methods=NULL, clust.methods=NULL, file=NULL) dissim.pvar.plot(data, is.OTU=TRUE, stand.method=NULL, dist.methods=NULL, file=NULL)

Arguments

data
a list of ecology data. See also RAM.input.formatting
is.OTU
logical, whether the ecology data sets are OTU tables or taxonomy abundance matrices.
stand.method
optional, if is.null, the standardization method for data transforamtion; must be one of the following: "total", "max", "frequency", "normalize", "range", "standardize", "pa", "chi.square", "hellinger", "log". See also decostand.
dist.methods
a character vector representing the dissimilarity indices to be used; each element must be one of one of "manhattan", "euclidean", "canberra", "bray", "kulczynski", "jaccard", "gower", "altGower","morisita", "horn", "mountford", "raup", "binomial", "chao", or "cao".
clust.methods
a character vector representing the methods used for clustering the data. Each element must be one of "ward", "single", "complete", "average", "mcquitty", "median", or "centroid".
k
the number of dimensions desired. If NULL, the maximum value will be calculated and used.
file
the file path for the plot. If not provided (defaults to NULL), then the plot is displayed to the screen. If file is provided, that is where the .tiff file will be created.

Value

All functions create a plot and return the plotted data invisibly.
dissim.clust.plot
plots a hierarchical clustering of the dissimilarity matrix.
dissim.eig.plot
plots a bar plot of the eigenvalues of the dissimilarity matrix.
dissim.alleig.plot
plots a line plot showing the relative importance of all eigenvalues for a variety of methods.
dissim.ord.plot
plots a scatter plot comparing the "euclidean" distances among all samples in ordination space to the dissimilarity matrix distances.
dissim.GOF.plot
plots a scatter plot of the goodness of fit values of the dissimilarity matrix, for various numbers of dimensions used.
dissim.tree.plot
plots a scatter plot comparing the tree distances to the dissimilarity matrix distances.
dissim.pvar.plot
plots a bar plot showing the percent variation explained by each axis (where each sample corresponds to an axis).

Details

All of these functions (other than dissim.alleig.plot) call dissim.X counterparts and plot the data. If file is given, a .tiff file will be created at file; otherwise the plot is displayed to the screen.

See Also

vegdist, hclust, dissim, ggplot

Examples

Run this code
data(ITS1, ITS2)
data <- list(ITS1=ITS1, ITS2=ITS2)
# show percent variation for only ITS1 with default methods
dissim.pvar.plot(data=list(ITS1=ITS1))
## Not run: 
# # show clustering for ITS1 and ITS2 for set methods
# dissim.clust.plot(data=data, is.OTU=TRUE, stand.method=NULL,
#                   dist.methods=c("morisita", "bray"),
#                   clust.methods=c("average", "centroid"))
# dissim.ord.plot(data=data, is.OTU=TRUE, stand.method="total",
#                 dist.method="bray")
# # dissim.alleig.plot returns a ggplot2 object:
# my.eig.plot <- dissim.alleig.plot(data)
# class(my.eig.plot) # returns "gg" "ggplot"
# my.eig.plot # view the plot
# # update the title, then view the updated plot
# my.eig.plot <- my.eig.plot + ggtitle("My New Title")
# # update ggplot theme
# require("grid")
# new_theme <-RAM.color()
# my.eig.plot <- my.eig.plot + new_theme
# my.eig.plot
# # save an image (named file.pdf) with GOF values for ITS1 and 
# # ITS2, using default methods
# dissim.GOF.plot(data=data, file="~/Documents/my/file")
# ## End(Not run)

Run the code above in your browser using DataLab