CorrPlot: Plot the correlation diagram of two datasets

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

Description

A function to calculate the correlation coefficients and plot the correlation diagram (8 types) of two input datasets.

Usage

1
2
CorrPlot(dataset1,dataset2,cor.method = "spearman", filepath,
                 fig.form = "heatmap", design = FALSE)

Arguments

dataset1

The first dataset (data frame with required format). The first row should be column names. The first and the second column of the first row should be "Name" and "ID", and you can set 2 more tags at the third and the fourth column of the first row, such as "m.z" and "RT.min." or anything you like. From the fifth column till the end, sample indexes or names are expected. The first row of the data frame should be the gender information."1"means male, and "2" means female. The second row of the data frame should be the group information. The first column of the second row should be "group", and you can add group indexes of the data from the fifth column at the second row. The format of group number should be "0"(pre-dose). "1","2","3","4"...(post-dose). The third row of the data frame should be the information of timepoints. Please see the demo data for detailed format.

This variable maybe the results of GetEndo,GetAbso,GetSecdAbso.

dataset2

The second dataset (data frame with required format). The form of dataset2 is the same as the form of dataset1. This variable maybe the results of GetEndo,GetAbso,GetSecdAbso.

cor.method

A character string indicating which correlation analysis ("pearson", "kendall", or "spearman") is to be used. Default: "spearman".

filepath

A character string indicating the path where the results may be saved in.

fig.form

The form of the correlation diagram. figure.fig.form=c("heatmap","bubble","ordered.bubble","chord","square","ord.square","pie","ord.pie"). Default: "heatmap".

design

(optional) a study design dataset(data frame with required format).Use data(design) to see the detailed format. Default:"FALSE".

Details

nothing

Value

A folder named “CorrelationResults” containing three folders: "CorrelationResults(all)", "CorrelationResults(female)" and "CorrelationResults(male)". Each folder with three files will be created automatically.

p-value.xlsx: The p values of the correlation analysis.

r-value.xlsx: The r values of the correlation analysis.

correlation-matrix-HeatMap.pdf/correlation-matrix-ChordDiagram.pdf/ (ordered-)correlogram-square.pdf /(ordered-)correlogram-pie.pdf /correlation-matrix(-ordered)-BubbleDiagram.pdf: A PDF file which contains the selected form of correlation diagram.If the study design is given by right format, the time points of meals and sleeps will be described at the bottom of the picture.

Note

nothing

Author(s)

Mengci Li, Shouli Wang, Guoxiang Xie, Tianlu Chen and Wei Jia

References

nothing

See Also

ScatPlot:plot the PCA or PLS score figures and trajectories on input data.

HeatMap: plot heatmap of the input data.

Examples

1
2
3
4
5
##---- Should be DIRECTLY executable !! ----
data("B")
data("C")
CorrPlot(B,C,filepath=getwd(),fig.form="heatmap",design=FALSE)
##----the result is saved in your current working directory of the R process

Example output

Loading required package: impute
Loading required package: pcaMethods
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.


Attaching package:pcaMethodsThe following object is masked frompackage:stats:

    loadings

Loading required package: xlsx
png 
  2 
There were 50 or more warnings (use warnings() to see the first 50)

polyPK documentation built on May 2, 2019, 12:37 a.m.