X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=PrintRScript.py;h=9a920960cf7b613389e5ea332a84b4fea4c92ec6;hp=7ec15407223202e75074cb1ea5bf196e5f26d489;hb=0ddddd038d216355e285058b9308f1975de0105a;hpb=1a995a6ca4e8dbb09c8b9ab1276dabf17e065f0d diff --git a/PrintRScript.py b/PrintRScript.py index 7ec1540..9a92096 100644 --- a/PrintRScript.py +++ b/PrintRScript.py @@ -173,12 +173,12 @@ def RchdTxt(DicoPath, RscriptPath, mincl, classif_mode, nbt = 9, libsvdc = False """ % DicoPath['listeuce2'] txt += """ -# rm(data1) + rm(data1) """ if classif_mode == 0: txt += """ -# rm(data2) + rm(data2) """ txt += """ chd.result <- Rchdtxt("%s",mincl=%i,classif_mode=%i, nbt = nbt) @@ -275,7 +275,7 @@ def RchdQuest(DicoPath, RscriptPath, nbcl = 10, mincl = 10): chd.result<-Rchdquest("%s","%s","%s", nbt = nbt, mincl = mincl) n1 <- chd.result$n1 classeuce1 <- chd.result$cuce1 - """ % (DicoPath['Act01'], DicoPath['listeuce1'], DicoPath['uce']) + """ % (DicoPath['mat01'], DicoPath['listeuce1'], DicoPath['uce']) txt += """ tree_tot1 <- make_tree_tot(chd.result$chd) @@ -378,6 +378,10 @@ write.csv2(gbcluster,file="%s") xmax <- max(afc$rowcoord[,1], na.rm = TRUE) + (0.1 * max(afc$rowcoord[,1], na.rm = TRUE)) ymin <- min(afc$rowcoord[,2], na.rm = TRUE) + (0.1 * min(afc$rowcoord[,2], na.rm = TRUE)) ymax <- max(afc$rowcoord[,2], na.rm = TRUE) + (0.1 * max(afc$rowcoord[,2], na.rm = TRUE)) + print(xmin) + print(xmax) + print(ymin) + print(ymax) """ % taillecar txt += """ PlotAfc2dCoul(afc, as.data.frame(chistabletot), "%s", what='coord', deb=1, fin=(debsup-1), xlab = xlab, ylab = ylab, xmin=xmin, xmax=xmax, ymin = ymin, ymax=ymax) @@ -431,6 +435,9 @@ def write_afc_graph(self): if self.param['tchi'] : tchi = 'TRUE' else : tchi = 'FALSE' + if self.param['svg'] : svg = 'TRUE' + else : svg = 'FALSE' + with open(self.RscriptsPath['afc_graph'], 'r') as f: txt = f.read() @@ -460,7 +467,8 @@ def write_afc_graph(self): tchi,\ self.param['tchi_min'],\ self.param['tchi_max'],\ - ffr(os.path.dirname(self.fileout))) + ffr(os.path.dirname(self.fileout)),\ + svg) return scripts def print_simi3d(self): @@ -540,11 +548,23 @@ def barplot(table, rownames, colnames, rgraph, tmpgraph, intxt = False) : tominf <- which(di == -Inf) if (length(toinf)) { di[toinf] <- NA - di[toinf] <- max(di, na.rm = TRUE) + 2 + valmax <- max(di, na.rm = TRUE) + if (valmax <= 0) { + valmax <- 2 + } else { + valmax <- valmax + 2 + } + di[toinf] <- valmax } if (length(tominf)) { di[tominf] <- NA - di[tominf] <- min(di, na.rm = TRUE) - 2 + valmin <- min(di, na.rm = TRUE) + if (valmin >=0) { + valmin <- -2 + } else { + valmin <- valmin - 2 + } + di[tominf] <- valmin } rownames(di)<- %s colnames(di) <- %s