[Corpusreader-svn] SF.net SVN: corpusreader:[230] trunk/corpusreader/src/main/R/visu-chi2.r
Status: Alpha
Brought to you by:
sylvainloiseau
|
From: <syl...@us...> - 2010-01-23 10:33:35
|
Revision: 230
http://corpusreader.svn.sourceforge.net/corpusreader/?rev=230&view=rev
Author: sylvainloiseau
Date: 2010-01-23 10:33:28 +0000 (Sat, 23 Jan 2010)
Log Message:
-----------
local modif
Modified Paths:
--------------
trunk/corpusreader/src/main/R/visu-chi2.r
Modified: trunk/corpusreader/src/main/R/visu-chi2.r
===================================================================
--- trunk/corpusreader/src/main/R/visu-chi2.r 2009-11-05 15:56:58 UTC (rev 229)
+++ trunk/corpusreader/src/main/R/visu-chi2.r 2010-01-23 10:33:28 UTC (rev 230)
@@ -39,7 +39,7 @@
## ----------
# mdat <- matrix(c(1,2,3,11,12,13), nrow = 2, ncol=3, byrow=TRUE, dimnames=list(c("R1", "R2"), c("C1", "C2", "C3")));
# mdat <- matrix(c(2,58,18,22), nrow = 2, ncol=2, byrow=TRUE, dimnames=list(c("bleu", "vert"), c("blond", "brun")));
-# mdat <- matrix(c(5,55,15,25,23,13), nrow = 2, ncol=3, byrow=TRUE, dimnames=list(c("partie 1", "partie 2"), c("b\xE9b\xE9", "gentil", "agit\xE9")));
+# mdat <- matrix(c(5,55,15,25,23,13), nrow = 2, ncol=3, byrow=TRUE, dimnames=list(c("partie 1", "partie 2"), c("bÈbÈ", "gentil", "agitÈ")));
# or :
# mdat <- matrix(c(7,5,20,16,40,33), nrow = 3, ncol=2, byrow=TRUE, dimnames=list(c("DC", "NREA", "REA"), c("BAS", "CES")));
# plotTwoCategorialVariables(mdat);
@@ -64,14 +64,14 @@
## TODO
## - autres graphiques
-## * les sous-fr\xE9quences attendues dans tout le tableau
-## * les sous-fr\xE9quences attendues plus les sous-fr\xE9quences observ\xE9es dans tout le tableau
-## * le total d'une variable dans un carr\xE9
-#* Le total d'une variable et les fr\xE9quences attendues/observ\xE9es de cette variable dans une modalit\xE9 de l'autre variable.
+## * les sous-frÈquences attendues dans tout le tableau
+## * les sous-frÈquences attendues plus les sous-frÈquences observÈes dans tout le tableau
+## * le total d'une variable dans un carrÈ
+#* Le total d'une variable et les frÈquences attendues/observÈes de cette variable dans une modalitÈ de l'autre variable.
## * des marques du calcul
-## - rendre optionnel l'affichage des valeurs num\xE9riques
+## - rendre optionnel l'affichage des valeurs numÈriques
## - vectoriser pour rect
-## - remonter le calcul des coordonn\xE9s
+## - remonter le calcul des coordonnÈs
## - utiliser "grid"
plotTwoCategorialVariables <- function(m, usedim1 = TRUE, margin = 0.05, obswidth=2, showObserved=TRUE, showLabel=TRUE, squarecolor="green", squarecolorcel="yellow", threshold=FALSE) {
@@ -123,19 +123,19 @@
# op <- par(las = 1, lend="square");
plot(c(0, 1), c(0, 1), type="n", ann=FALSE, axes=FALSE);
#box(which="plot", lty = '1373', col = 'red');
- mtext("D\xE9pendance entre deux variables", side=3, line=3);
+ mtext("Dépendance entre deux variables", side=3, line=3);
## Make the axis
## -------------------------------
axis(2, at=cellVerticalCoordinates[2:rowNbr]+cellHeight/2, labels=attr(m, "dimnames")[[1]]);
- mtext("Modalit\xE9s de la premi\xE8re variable", side=2, adj=1, line=2);
- mtext("Total 2nd variable", side=2, adj=0, line=2);
+ mtext("Modalités de la première variable", side=2, adj=1, line=2);
+ mtext("Total 2nd variable", side=2, adj=0, line=1);
axis(3, at=cellHorizontalCoordinates[1:(colNbr-1)]+cellWidth/2, labels=attr(m, "dimnames")[[2]]);
- mtext("Modalit\xE9s de la seconde variable", side=3, adj=0, line=2);
- mtext("Total 1\xE8re variable", side=3, adj=1, line=2);
+ mtext("Modalités de la seconde variable", side=3, adj=0, line=2);
+ mtext("Total 1ère variable", side=3, adj=1, line=1);
- ##\xA0draw the frame
+ ##†draw the frame
## -------------------------------
for(i in 1:(rowNbr-1)) {
lines(c(0,1), rep(i*cellHeight, 2));
@@ -145,10 +145,10 @@
lines(rep(i*cellWidth, 2), c(0,1));
}
- ##\xA0draw the boxes
+ ##†draw the boxes
## -------------------------------
- #\xA0the coordinate of each corner of the boxes.
+ #†the coordinate of each corner of the boxes.
# for each modalities of each variable (i.e. each box), there is *four*
# corners, and each corner is defined by *two* coordinates.
boxCoordinates <- array(dim=c(rowNbr,colNbr, 4, 2));
@@ -165,7 +165,7 @@
}
}
- ##\xA0draw lines from corner 1 to corner 2 and three and from corner 2 and 3 to
+ ##†draw lines from corner 1 to corner 2 and three and from corner 2 and 3 to
## corner 4 for each box.
for (i in 1:rowNbr) {
for (j in 1:colNbr) {
@@ -266,7 +266,7 @@
# add the text
if (showLabel) {
- text(j*cellWidth + margin, (i+1)*cellHeight - margin, labels=paste(" th\xE9orique :\n", expected[i, j+1], "%\n", "observ\xE9 :\n", actual[i, j + 1], "%"), adj=c(0,1), cex=.8);
+ text(j*cellWidth + margin, (i+1)*cellHeight - margin, labels=paste(" thÈorique :\n", expected[i, j+1], "%\n", "observÈ :\n", actual[i, j + 1], "%"), adj=c(0,1), cex=.8);
}
# add the expected value rect
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|