A function to calculate the correlation coefficients and plot the correlation diagram (8 types) of two input datasets.
CorrPlot(dataset1,dataset2,cor.method = "spearman", filepath,
fig.form = "heatmap", design = FALSE)
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.
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.
A character string indicating which correlation analysis ("pearson", "kendall", or "spearman") is to be used. Default: "spearman".
A character string indicating the path where the results may be saved in.
The form of the correlation diagram. figure.fig.form=c("heatmap","bubble","ordered.bubble","chord","square","ord.square","pie","ord.pie"). Default: "heatmap".
(optional) a study design dataset(data frame with required format).Use data(design) to see the detailed format. Default:"FALSE".
A folder named <U+201C>CorrelationResults<U+201D> 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.
nothing
nothing
ScatPlot:plot the PCA or PLS score figures and trajectories on input data.
HeatMap: plot heatmap of the input data.
# NOT RUN {
##---- 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
# }
Run the code above in your browser using DataLab