CSlabelscompare: Compare Automatic Factor Labels with Manual Provided Labels.

Description Usage Arguments Examples

View source: R/extra.R

Description

With this function you can compare the automatic created labels based of the absolute loadings in CSanalysis (which=8) with your own provided labels to investigate if there is relation between them.
See the type parameter which two plots can be created.
Note that the automatic created factor labels in CSanalysis denote which factors this loading has a high/low value and these can be regenerated (with different a different cut-off) by simply running CSanalysis again. Providing result.available will skip the analysis computation step and only regenerate the labels.

Usage

1
2
CSlabelscompare(CSresult, labels, type = "factors",
  basefilename = "CSanalysis", plot.type = "device")

Arguments

CSresult

Object of CSresult S4 Class.

labels

Provide a vector with labels. (Length should be the number of queries and references together)

type
  • type="factorlabels":
    A K number of plots will be created (K = number of components in the analysis). Each plot will have the loadings on the y-axis and the original automatic generated factor labels on the x-axis. The loadings are plotted for these factor labels (with jitter) and are colored according to the manual provided labels (labels) which is shown in the legend. The coloring also shows which loadings were in the query set.

  • type="factors":
    A K number of plots will be created (K = number of components in the analysis). Each plot will have the loadings on the y-axis and factor labels on the x-axis. These factor labels are not exactly the generated labels, but simply "Factor 1", "Factor 2",..., "None" or "BC 1", "BC 2",..., "None". This means that should a loading be high/low in multiple factors, it will appear multiple times on this plot, namely for each corresponding factor. The loadings are plotted for these factor labels (with jitter) and are colored according to the manual provided labels (labels) which is shown in the legend. The coloring also shows which loadings were in the query set.

Note that if none of the loadings is high/low in multiple factors, the two types of plots should be identical.

basefilename

Base of the filename when saving the graph as a pdf (plot.type="pdf")

plot.type

How should the plots be outputted? "pdf" to save them in pdf files, device to draw them in a graphics device (default), sweave to use them in a sweave or knitr file.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data("dataSIM",package="CSFA")
Mat1 <- dataSIM[,c(1:6)]
Mat2 <- dataSIM[,-c(1:6)]

MFA_out <- CSanalysis(Mat1,Mat2,"CSmfa",component.plot=1,which=c())

labels <- rep("Noise",ncol(dataSIM))
labels[c(1:31,332:341)] <- "Signal"

CSlabelscompare(CSresult=MFA_out,labels=labels,type="factors")
CSlabelscompare(CSresult=MFA_out,labels=labels,type="factorlabels")

ewouddt/CSFA documentation built on May 20, 2019, 6:44 p.m.