- for (i in 1:length(toplot)) {
- rtoplot <- toplot[[i]]
- if (length(rtoplot)) {
- par(mar=c(0,0,2,0))
- if (cloud) {
- labels <- paste(rownames(x)[rtoplot], x[rtoplot,1], x[rtoplot,2], sep='-')
- wordcloud(labels, x[rtoplot,1], scale = c(max(labcex[rtoplot]), min(labcex[rtoplot])), color = labalpha[rtoplot], random.order=FALSE, rot.per = 0)
- box()
- } else {
- yval <- 1.1
- plot(0,0,pch='', axes = FALSE)
- k<- 0
- for (val in rtoplot) {
- yval <- yval-(strheight(rownames(x)[val],cex=labcex[val])+0.02)
- text(-0.9, yval, paste(rownames(x)[val], x[val,1], x[val,2], sep = '-'), cex = labcex[val], col = labalpha[val], adj=0)
- }
- box()
- }
- title(ti[i])
- }
- }
- mtext(paste('<', mfreq, ' Fréquences ', '>=', mfreq, sep = ' '), side=2, line=1, cex=1, col="red", outer=TRUE)
- mtext(paste('<=', mrank, ' Rangs ', '>', mrank, sep = ' '), side=3, line=1, cex=1, col="red", outer=TRUE)
+ if (type == 'classical') {
+ par(oma=c(1,3,3,1))
+ layout(matrix(c(1,4,2,3), nrow=2))
+ for (i in 1:length(toplot)) {
+ rtoplot <- toplot[[i]]
+ if (length(rtoplot)) {
+ par(mar=c(0,0,2,0))
+ if (cloud) {
+ labels <- paste(rownames(x)[rtoplot], x[rtoplot,1], x[rtoplot,2], sep='-')
+ wordcloud(labels, x[rtoplot,1], scale = c(max(labcex[rtoplot]), min(labcex[rtoplot])), color = labalpha[rtoplot], random.order=FALSE, rot.per = 0)
+ box()
+ } else {
+ yval <- 1.1
+ plot(0,0,pch='', axes = FALSE)
+ k<- 0
+ for (val in rtoplot) {
+ yval <- yval-(strheight(rownames(x)[val],cex=labcex[val])+0.02)
+ text(-0.9, yval, paste(rownames(x)[val], x[val,1], x[val,2], sep = '-'), cex = labcex[val], col = labalpha[val], adj=0)
+ }
+ box()
+ }
+ title(ti[i])
+ }
+ }
+ mtext(paste('<', mfreq, ' Fréquences ', '>=', mfreq, sep = ' '), side=2, line=1, cex=1, col="red", outer=TRUE)
+ mtext(paste('<=', mrank, ' Rangs ', '>', mrank, sep = ' '), side=3, line=1, cex=1, col="red", outer=TRUE)
+ } else if (type == 'plan') {
+ par(oma=c(3,3,1,1))
+ textplot(x[,1], x[,2], rownames(x), cex=labcex, xlim=c(min(x[,1])-nrow(x)/3, max(x[,1])+5), ylim = c(min(x[,2])-0.2, max(x[,2])+0.5), col=labcol, xlab="", ylab="")
+ abline(v=mfreq)
+ abline(h=mrank)
+ legend('topright', ti, fill=c('blue', 'red', 'green', 'black'))
+ mtext(paste('<', mfreq, ' Fréquences ', '>=', mfreq, sep = ' '), side=1, line=1, cex=1, col="red", outer=TRUE)
+ mtext(paste('<=', mrank, ' Rangs ', '>', mrank, sep = ' '), side=2, line=1, cex=1, col="red", outer=TRUE)
+ }
+}
+
+intervalle.freq <- function(x, SX=NULL) {
+ errorn <- (x/SX) + (1.96 * sqrt(((x/SX) * (1-(x/SX))/SX)))
+ print(errorn)