if (!col) {
classes <- as.matrix(apply(chitable,1,which.max))
cex.par <- norm.vec(apply(chitable,1,max), 0.8,3)
- row.keep <- select.chi.classe(chitable, 60)
+ row.keep <- select.chi.classe(chitable, 80)
rowcoord <- rowcoord[row.keep,]
classes <- classes[row.keep]
cex.par <- cex.par[row.keep]
classes <- 1:clnb
cex.par <- rep(1,clnb)
}
+ if (is.null(xmin)) {
+ table.in <- rowcoord
+ xminmax <- c(min(table.in[,1], na.rm = TRUE) + ((max(cex.par)/10) * min(table.in[,1], na.rm = TRUE)), max(table.in[,1], na.rm = TRUE) + ((max(cex.par)/10) * max(table.in[,1], na.rm = TRUE)))
+ xmin <- xminmax[1]
+ xmax <- xminmax[2]
+ yminmax <- c(min(table.in[,2], na.rm = TRUE) + ((max(cex.par)/10) * min(table.in[,2], na.rm = TRUE)), max(table.in[,2], na.rm = TRUE) + ((max(cex.par)/10) * max(table.in[,2], na.rm = TRUE)))
+ ymin <- yminmax[1]
+ ymax <- yminmax[2]
+ }
#ntabtot <- cbind(rowcoord, classes)
#if (!col) ntabtot <- ntabtot[row_keep,]
xlab <- paste('facteur ', x, ' -')
table.in <- rowcoord[order(cex.par, decreasing = TRUE),]
classes <- classes[order(cex.par, decreasing = TRUE)]
cex.par <- cex.par[order(cex.par, decreasing = TRUE)]
- table.in <- stopoverlap(table.in, cex.par=cex.par, xlim = c(xmin,xmax), ylim = c(ymin,ymax))
+ table.out <- stopoverlap(table.in, cex.par=cex.par, xlim = c(xmin,xmax), ylim = c(ymin,ymax))
+ table.in <- table.out$toplot
+ notplot <- table.out$notplot
+ if (! is.null(notplot)) {
+ write.csv2(notplot, file = paste(filename, '_notplotted.csv', sep = ''))
+ }
classes <- classes[table.in[,4]]
cex.par <- cex.par[table.in[,4]]
make_afc_graph(table.in, classes, clnb, xlab, ylab, cex.txt = cex.par, xminmax=c(xmin,xmax), yminmax=c(ymin,ymax))
-
+ xyminmax <- list(yminmax = c(ymin,ymax), xminmax = c(xmin,xmax))
+ xyminmax
#plot(rowcoord[,x],rowcoord[,y], pch='', xlab = xlab, ylab = ylab)
#abline(h=0,v=0)
#for (i in 1:clnb) {
thetaStep <- .1
rStep <- .5
toplot <- NULL
+ notplot <- NULL
# plot.new()
plot(x[,1],x[,2], pch='', xlim = xlim, ylim = ylim)
} else {
if(r>sqrt(.5)){
print(paste(words[i], "could not be fit on page. It will not be plotted."))
+ notplot <- rbind(notplot,c(words[i], x[i,1], x[i,2]))
isOverlaped <- FALSE
}
theta <- theta+thetaStep
}
}
row.names(toplot) <- words[toplot[,4]]
- return(toplot)
+ return(list(toplot = toplot, notplot = notplot))
}
###############################################################################