## load an example of IcaSet
data(icaSetCarbayo)
## build object of class MineICAParams
params <- buildMineICAParams(resPath="carbayo/")
## cluster samples according to the columns of the mixing matrix A with kmeans in 2 groups
resClus <- clusterSamplesByComp(icaSet=icaSetCarbayo, params=params, funClus="kmeans",
clusterOn="A", nbClus=2)$clus
## specify directory for the function outputs (here same directory as the default one)
## this directory will be created by the function in resPath(params)
dir <- "clus2var/"
## compute chi-square tests of association, p-value are not adjusted (adjustBy="none"),
# test results are written in txt format (doPlot=FALSE and filename not missing)
resChi <- clusVarAnalysis(icaSet=icaSetCarbayo, params=params, resClus=resClus, funClus="kmeans",
adjustBy="none", doPlot=FALSE, path=dir, filename="clusVarTests")
## Not run:
# ## compute chi-square tests of association, p-value are not adjusted (adjustBy="none"),
# # write results and plots in HTML files (doPlot=TRUE)
# resChi <- clusVarAnalysis(icaSet=icaSetCarbayo, params=params, resClus=resClus, funClus="kmeans",
# path=dir, adjustBy="none", doPlot=TRUE, filename="clusVarTests")
#
# ## compute chi-square tests of association by only considering a subset of components and variables,
# # adjust p-values by component (adjustBy="component"),
# # do not write results (doPlot=FALSE and filename is missing).
# resChi <- clusVarAnalysis(icaSet=icaSetCarbayo, params=params, resClus=resClus, keepComp = 1:10,
# keepVar=c("GENDER","STAGE"), funClus="kmeans", adjustBy="none",
# doPlot=FALSE)
# ## End(Not run)
Run the code above in your browser using DataLab