X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=PrintRScript.py;h=606056d3f35ad51ec4a917d305417c40075c9253;hp=8e54bf42bcfc315eb0b92648fd8dbd39aa4c02c4;hb=dfa19a4244934acba4bb0bb7931c9b119fee112a;hpb=b02f2cba3d8c7dba29a54de8b589626d008d2c5b diff --git a/PrintRScript.py b/PrintRScript.py index 8e54bf4..606056d 100644 --- a/PrintRScript.py +++ b/PrintRScript.py @@ -1210,6 +1210,31 @@ class TgenSpecScript(PrintRScript): colnames(result) <- colnames(tgen) row.names(result) <- rownames(tgen) write.table(result, file = "%s", sep='\\t', col.names = NA) - """ % self.pathout['tgenspec.csv'] + """ % ffr(self.pathout['tgenspec.csv']) self.add(txt) +class FreqMultiScript(PrintRScript): + def make_script(self): + self.sources([self.analyse.parent.RscriptsPath['Rgraph']]) + txt = """ + freq <- read.csv2("%s", row.names=1, sep='\\t', dec='.') + """ % ffr(self.pathout['frequences.csv']) + txt += """ + toplot <- freq[order(freq[,2]) ,2] + toplot.names = rownames(freq)[order(freq[,2])] + h <- 80 + (20 * nrow(freq)) + open_file_graph("%s",height=h, width=500) + par(mar=c(3,20,3,3)) + barplot(toplot, names = toplot.names, horiz=TRUE, las =1, col = rainbow(nrow(freq))) + dev.off() + """ % ffr(self.pathout['barplotfreq.png']) + txt += """ + toplot <- freq[order(freq[,4]) ,4] + toplot.names = rownames(freq)[order(freq[,4])] + open_file_graph("%s",height=h, width=500) + par(mar=c(3,20,3,3)) + barplot(toplot, names = toplot.names, horiz=TRUE, las =1, col = rainbow(nrow(freq))) + dev.off() + """ % ffr(self.pathout['barplotrow.png']) + self.add(txt) + self.write() \ No newline at end of file