if dlg is None :
return
else :
- dial = FreqDialog(self.parent, -1, self.tableau.get_colnames(), u"Fréquences", size=(350, 200))
+ dial = FreqDialog(self.parent, self.tableau.get_colnames(), u"Fréquences")
dial.CenterOnParent()
val = dial.ShowModal()
if val == wx.ID_OK :
- self.parametres['colsel'] = dial.list_box_1.GetSelections()
+ self.parametres['colsel'] = dial.m_listBox1.GetSelections()
self.parametres['header'] = dial.header
+ self.parametres['NA'] = dial.includeNA.GetValue()
else :
self.parametres = None
dial.Destroy()
compteur <- 1
""" % (sel, listfiles, titles)
+ if self.parametres['NA'] :
+ txt += """
+ countNA <- TRUE
+ """
+ else :
+ txt += """
+ countNA <- FALSE
+ """
+
txt += """
for (i in select) {
- freq <- table(dm[,i])
+ if (countNA) {
+ freq <- table(dm[,i], useNA = 'ifany')
+ } else {
+ freq <- table(dm[,i])
+ }
sumfreq <- sum(freq)
pour <- prop.table(as.matrix(freq), 2) * 100
sumpour <- sum(pour)
+ pour <- round(pour, 2)
ntable <- cbind(as.matrix(freq), pour)
graphout <- listfiles[compteur]
if (Sys.info()["sysname"]=='Darwin') {
content = f.read().splitlines()
content.pop(0)
content.pop(0)
+ content = ['\t'.join(line.split('\t')[1:]).replace('"','') for line in content]
+ content = '\n'.join(content)
+ content = content.split(u'***\t****\t****')
+ content = [[line.split('\t') for line in tab.splitlines() if line.split('\t') != ['']] for tab in content]
+ listtab = [tab for tab in content if tab != []]
texte = ''
- for ligne in content:
- ligne = ligne.replace('"', '')
- ligne = ligne.split('\t')
- if ligne[1] == u'***' :
- if tab != []:
- listtab.append(tab)
- tab = []
- else :
- tab.append(ligne)
+ #for ligne in content:
+ # ligne = ligne.replace('"', '')
+ # ligne = ligne.split('\t')
+ # if ligne[1] == u'***' :
+ # if tab != []:
+ # listtab.append(tab)
+ # tab = []
+ # else :
+ # tab.append(ligne)
pretexte = u'''<html>
<meta http-equiv="content-Type" content="text/html; charset=%s" />
<body>\n<h1>Fréquences</h1>
texte += '<tr>'
texte += """
<td>%s</td><td align=center>%s</td><td align=center>%s %%</td>
- """ % (line[3], line[1], line[2])
+ """ % (line[2], line[0], line[1])
texte += '</tr>'
texte += '</table></td>'
texte += """