dissim.plot: Plot Dissimilarity Matrix Data for Different Methods

Description Usage Arguments Details Value Note Author(s) See Also Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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.

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.

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).

Note

If file does not end in ".tiff", then ".tiff" will be appended to the end of file. Function dissim.alleig.plot uses the ggplot2 package for creating the plot, and returns the plot object. This means that you can store this plot and add other features manually, if desired (see Examples).

Author(s)

Wen Chen and Joshua Simpson

See Also

vegdist, hclust, dissim, ggplot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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)

RAM documentation built on May 2, 2019, 3:04 p.m.