Produces PCA plots of the metabolomics data.
PcaPlots(featuredata, groupdata, saveplot = FALSE,
saveinteractiveplot = FALSE, plotname = "", savetype = c("png", "bmp",
"jpeg", "tiff", "pdf"), interactiveonly = FALSE, interactiveplots = TRUE,
y.axis = 1, x.axis = 2, center = TRUE, scale = TRUE,
userinput = TRUE, returninteractive = FALSE, main = NULL,
varplot = FALSE, multiplot = FALSE, n = 3, cols = NULL,
cex_val = 0.7, ...)
featuredata A data frame in the featuredata format. This is a dataframe with metabolites in columns and samples in rows. Unique sample names should be provided as row names. See NormalizeMets Vignette for details.
A data frame or a vector with group names.
A logical indication whether to save the plot produced.
A logical indication whether to save the interactive plots produced.
Name of the output file if the file is to be saved. This is the general name for all the graphs and the specific type prefix will be added automatically.
The required format for the plot to be saved in. Threre is a
choice of "png","bmp","jpeg","tiff","pdf"
type files.
Alogical indicating whether to show interactive plots only.
A logical indication whether an interactive plot is to be shown.
The principal component to be plotted on the y-axis.
The principal component to be plotted on the x-axis.
A logical indicating whether the variables should be scaled to have zero mean.
A logical indicating whether the variables should be scaled to have unit variance before the analysis takes place.
A logical indication whether user input should be required to
show plots progressively. Should be FALSE
when the plots are to be passed
on to other functions or saved as variables for later use.
A logical indication whether a list of the interactive plots should be returned by the function
Plot title.
A logical indicating whether explained variance should be plotted.
If TRUE
, pairs plots of the first n principal
components will be plotted.
The number of principal components to be plotted if
multiplot=TRUE
. The default value is set to 5.
A character string with colours to be used.
A numeric indicating the size of some text elements.
Arguments to be passed on to other methods.
# NOT RUN {
data(mixdata)
# produce all results
PcaPlots(mixdata$featuredata,mixdata$sampledata[,3],multiplot = TRUE,
varplot = TRUE, interactiveplots = TRUE)
# return a list of the ineractive plots only
interactive.pca <- PcaPlots(mixdata$featuredata,mixdata$sampledata[,3],
interativeonly = TRUE, interactiveplots = TRUE,
userinput = FALSE, returninteractive = TRUE)
# }
Run the code above in your browser using DataLab