R version 2.11.1 (2010-05-31) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > date() [1] "Fri Feb 25 05:10:56 2011" > ################################################### > ### chunk number 2: embryo1 > ################################################### > res <- c(64, 223, 243, 326, 144, 373, 234, 112, 219, 62, 227, 224, 166, 282, 100, 88, 218, 259, 289, 146, 203, 157, 137, 373, 130, 207, 329, 154, 223, 88, 138, 154, 98, 382, 229, 255, 168, 117, 236, 224, 215, 188, 125, 298, 174) > embryon <- matrix(res, nrow=9, ncol=5, byrow=T) > embryon <- as.data.frame(embryon) > colnames(embryon) <- c("CC","CCHB","HBCC","HB","nR") > rownames(embryon) <- c("Autriche","Danemark","France","Allemagne","Italie","Pays_Bas","Pologne","Royaume_Uni","Espagne") > > > ################################################### > ### chunk number 3: embryo2 > ################################################### > apply(embryon,1,sum) Autriche Danemark France Allemagne Italie Pays_Bas 1000 1000 999 1000 1000 1001 Pologne Royaume_Uni Espagne 1001 1000 1000 > > > ################################################### > ### chunk number 4: embryo3 > ################################################### > nonRep <- embryon[,5]/sum(embryon[,5]) > barplot(nonRep,names.arg=rownames(embryon),las=2) > abline(h=mean(nonRep),lwd=2,col="red") > > > ################################################### > ### chunk number 5: embryon4 > ################################################### > chisq.test(embryon[,-5]) Pearson's Chi-squared test data: embryon[, -5] X-squared = 689.055, df = 24, p-value < 2.2e-16 > mosaicplot(embryon[,-5],main="",shade=T,las=2) > > > ################################################### > ### chunk number 6: embryon5 > ################################################### > library(ade4) Attaching package: 'ade4' The following object(s) are masked from 'package:base': within > afc <- dudi.coa(embryon[,-5],scannf=F, nf=3) > afc$eig/sum(afc$eig) [1] 0.6722585 0.2678520 0.0598895 > cumsum(afc$eig)/sum(afc$eig) [1] 0.6722585 0.9401105 1.0000000 > > > ################################################### > ### chunk number 7: embryon6 > ################################################### > scatter(afc, posieig="none") NULL > > > ################################################### > ### chunk number 8: embryon7 > ################################################### > round(apply(embryon[,-5],1, function(x) x/sum(x)),4) Autriche Danemark France Allemagne Italie Pays_Bas Pologne Royaume_Uni CC 0.0748 0.3977 0.2525 0.1030 0.2333 0.2267 0.1788 0.3286 CCHB 0.2605 0.2495 0.2492 0.2553 0.1805 0.3604 0.1995 0.2165 HBCC 0.2839 0.1194 0.1846 0.3033 0.1575 0.1687 0.1269 0.1508 HB 0.3808 0.2335 0.3137 0.3384 0.4287 0.2442 0.4948 0.3041 Espagne CC 0.2603 CCHB 0.2276 HBCC 0.1513 HB 0.3608 > > > > proc.time() user system elapsed 0.464 0.040 0.502