R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), 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 a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("ade4-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('ade4') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "PI2newick" > > ### * PI2newick > > flush(stderr()); flush(stdout()) > > ### Name: PI2newick > ### Title: Import data files from Phylogenetic Independance Package > ### Aliases: PI2newick > ### Keywords: manip > > ### ** Examples > > x <- c(2.0266, 0.5832, 0.2460, 1.2963, 0.2460, 0.1565, -99.0000, + -99.0000, 10.1000, -99.0000, 20.2000, 28.2000, -99.0000, + 14.1000, 11.2000, -99.0000, 21.3000, 27.5000, 1.0000, 2.0000, + -1.0000, 4.0000, -1.0000, -1.0000, 3.0000, -1.0000, -1.0000, + 5.0000, -1.0000, -1.0000, 0.0000, 0.0000, 0.0000, 0.0000, + 0.0000, 0.0000) > x <- matrix(x, nrow = 6) > x <- as.data.frame(x) > res <- PI2newick(x) > dotchart.phylog(newick2phylog(res$tre), res$trait) > > > > cleanEx(); ..nameEx <- "RV.rtest" > > ### * RV.rtest > > flush(stderr()); flush(stdout()) > > ### Name: RV.rtest > ### Title: Monte-Carlo Test on the sum of eigenvalues of a co-inertia > ### analysis (in R). > ### Aliases: RV.rtest > ### Keywords: multivariate nonparametric > > ### ** Examples > > data(doubs) > pca1 <- dudi.pca(doubs$mil, scal = TRUE, scann = FALSE) > pca2 <- dudi.pca(doubs$poi, scal = FALSE, scann = FALSE) > rv1 <- RV.rtest(pca1$tab, pca2$tab, 99) > rv1 Monte-Carlo test Observation: 0.4505569 Call: RV.rtest(df1 = pca1$tab, df2 = pca2$tab, nrepet = 99) Based on 99 replicates Simulated p-value: 0.01 > plot(rv1) > > > > cleanEx(); ..nameEx <- "RVdist.randtest" > > ### * RVdist.randtest > > flush(stderr()); flush(stdout()) > > ### Name: RVdist.randtest > ### Title: Tests of randomization on the correlation between two distance > ### matrices (in R). > ### Aliases: RVdist.randtest > ### Keywords: multivariate nonparametric > > ### ** Examples > > > > > cleanEx(); ..nameEx <- "abouheif.eg" > > ### * abouheif.eg > > flush(stderr()); flush(stdout()) > > ### Name: abouheif.eg > ### Title: Phylogenies and quantitative traits from Abouheif > ### Aliases: abouheif.eg > ### Keywords: datasets > > ### ** Examples > > data(abouheif.eg) > par(mfrow=c(2,2)) > symbols.phylog(newick2phylog(abouheif.eg$tre1), abouheif.eg$vec1, + sub = "Body Mass (kg)", csi = 2, csub = 2) > symbols.phylog(newick2phylog(abouheif.eg$tre2), abouheif.eg$vec2, + sub = "Body Mass (kg)", csi = 2, csub = 2) > dotchart.phylog(newick2phylog(abouheif.eg$tre1), abouheif.eg$vec1, + sub = "Body Mass (kg)", cdot = 2, cnod = 1, possub = "topleft", + csub = 2, ceti = 1.5) > dotchart.phylog(newick2phylog(abouheif.eg$tre2), abouheif.eg$vec2, + sub = "Body Mass (kg)", cdot = 2, cnod = 1, possub = "topleft", + csub = 2, ceti = 1.5) > par(mfrow = c(1,1)) > > w.phy=newick2phylog(abouheif.eg$tre3) > dotchart.phylog(w.phy,abouheif.eg$vec3, clabel.n = 1) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "acacia" > > ### * acacia > > flush(stderr()); flush(stdout()) > > ### Name: acacia > ### Title: Spatial pattern analysis in plant communities > ### Aliases: acacia > ### Keywords: datasets > > ### ** Examples > > data(acacia) > par(mfcol=c(5,3)) > par(mar = c(2,2,2,2)) > for(k in 1:15) { + barplot(acacia[,k],ylim=c(0,20),col=grey(0.8)) + scatterutil.sub(names(acacia)[k],1.5,"topleft") + } > par(mfcol=c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "ade4toR" > > ### * ade4toR > > flush(stderr()); flush(stdout()) > > ### Name: ade4toR > ### Title: Format Change Utility > ### Aliases: ade4toR Rtoade4 > ### Keywords: utilities > > ### ** Examples > > data(tarentaise) > traits <- tarentaise$traits > Rtoade4(traits) File creation traits.txt File creation traits_col_lab.txt File creation traits_row_lab.txt File creation traits_col_bloc.txt File creation traits_col_bloc_lab.txt > # File creation traits.txt > # File creation traits_col_lab.txt > # File creation traits_row_lab.txt > # File creation traits_col_bloc.txt > # File creation traits_col_bloc_lab.txt > > mil <- tarentaise$envir > Rtoade4(mil) File creation mil.txt File creation mil_var_lab.txt File creation mil_moda_lab.txt > #File creation mil.txt > #File creation mil_var_lab.txt > #File creation mil_moda_lab.txt > > > > cleanEx(); ..nameEx <- "aminoacyl" > > ### * aminoacyl > > flush(stderr()); flush(stdout()) > > ### Name: aminoacyl > ### Title: Codon usage > ### Aliases: aminoacyl > ### Keywords: datasets > > ### ** Examples > > data(aminoacyl) > aminoacyl$genes [1] "YCR024C" "YDR268W" "YGR094W" "YGR171C" "YHR011W" "YHR091C" "YKL194C" [8] "YLR382C" "YNL073W" "YOL033W" "YPL040C" "YPL097W" "YPL104W" "YPR033C" [15] "YPR047W" "YNL247W" "YPR081C" "YBL076C" "YBR121C" "YDR023W" "YDR037W" [22] "YDR341C" "YER087W" "YFL022C" "YGL245W" "YGR185C" "YGR264C" "YHR019C" [29] "YIL078W" "YLR060W" "YOL097C" "YOR335C" "YPL160W" "YHR020W" "YOR168W" [36] "YLL018C" > aminoacyl$usage.codon YCR024C YDR268W YGR094W YGR171C YHR011W YHR091C YKL194C YLR382C YNL073W GCT 4 8 46 9 9 3 12 19 3 GCC 4 4 16 5 6 13 4 6 3 GCA 7 7 7 3 12 14 2 21 9 GCG 2 4 2 2 5 2 2 3 6 CGT 3 3 13 4 1 9 4 5 3 CGC 2 3 1 0 3 4 3 3 2 CGA 1 0 1 5 2 3 1 4 2 CGG 1 0 1 0 1 2 0 0 0 AGA 13 8 20 12 7 15 10 17 11 AGG 3 3 6 7 7 4 5 6 12 AAT 17 11 23 24 19 23 17 30 19 AAC 7 7 26 10 8 15 12 17 16 GAT 13 17 45 20 15 21 17 34 18 GAC 5 5 24 11 6 16 11 17 13 TGT 5 2 10 6 5 3 2 6 4 TGC 3 0 3 2 3 3 3 6 5 CAA 18 9 29 20 14 16 12 22 17 CAG 5 6 4 6 8 16 7 12 10 GAA 24 18 73 24 17 19 22 45 20 GAG 9 4 19 11 16 8 9 11 15 GGT 8 3 49 9 6 10 13 12 9 GGC 3 8 7 11 3 8 3 10 11 GGA 8 4 2 7 10 10 5 14 5 GGG 5 2 1 1 3 9 1 11 3 CAT 5 5 17 10 3 10 10 7 6 CAC 9 7 7 5 1 5 2 9 3 ATT 11 12 46 22 13 17 15 30 15 ATC 5 6 27 6 7 7 7 10 9 ATA 15 5 1 16 15 22 7 20 12 TTA 20 11 30 15 11 21 9 21 16 TTG 10 8 42 13 10 12 10 21 19 CTT 5 7 8 4 5 12 7 5 8 CTC 3 0 2 6 2 2 3 7 4 CTA 9 3 6 8 8 14 7 7 8 CTG 4 6 8 8 6 5 6 10 17 AAA 24 24 50 35 26 34 23 58 16 AAG 10 11 63 13 16 13 18 22 32 ATG 8 10 16 9 10 20 14 24 12 TTT 21 11 19 15 9 17 15 28 19 TTC 9 5 24 14 5 16 16 18 11 CCT 9 9 17 9 6 5 7 20 11 CCC 3 0 2 3 1 4 4 9 6 CCA 11 6 31 11 10 10 8 14 3 CCG 2 2 2 5 2 3 4 11 7 TCT 9 7 27 9 4 10 13 14 6 TCC 9 4 16 16 1 10 4 6 9 TCA 14 3 6 8 10 13 3 13 9 TCG 5 8 5 4 4 9 6 4 6 AGT 4 8 6 7 6 4 1 12 9 AGC 3 3 7 4 6 5 1 10 5 TAA 0 0 0 0 1 1 1 1 1 TAG 0 0 1 0 0 0 0 0 0 TGA 1 1 0 1 0 0 0 0 0 ACT 15 5 35 6 4 5 11 18 9 ACC 9 1 17 4 7 6 0 11 5 ACA 8 7 8 8 6 8 4 11 5 ACG 3 4 2 5 5 6 5 6 10 TGG 8 4 25 11 4 8 10 19 4 TAT 13 8 16 16 6 15 7 16 9 TAC 7 4 19 9 9 9 8 11 11 GTT 12 12 45 15 8 14 7 18 9 GTC 3 4 17 3 2 6 2 14 9 GTA 3 9 6 8 9 11 6 15 7 GTG 4 4 1 6 3 9 5 14 4 YOL033W YPL040C YPL097W YPL104W YPR033C YPR047W YNL247W YPR081C YBL076C GCT 8 12 12 12 29 5 23 6 26 GCC 5 8 3 11 10 4 14 4 18 GCA 9 17 3 9 10 1 11 9 11 GCG 5 5 5 3 3 3 1 2 1 CGT 2 4 3 3 4 4 3 3 15 CGC 1 7 0 1 0 3 3 2 1 CGA 3 4 5 2 1 1 0 5 0 CGG 3 0 2 2 0 0 0 1 1 AGA 14 18 7 17 11 16 16 16 28 AGG 6 13 11 9 6 4 2 9 1 AAT 12 29 19 26 11 16 27 22 19 AAC 14 22 10 11 5 11 23 12 27 GAT 22 36 20 25 24 23 34 23 48 GAC 6 16 9 14 11 9 19 13 30 TGT 10 11 6 3 5 1 4 6 9 TGC 1 3 1 5 0 5 2 2 0 CAA 9 32 11 13 12 9 28 13 20 CAG 6 17 11 10 4 3 9 12 4 GAA 22 53 15 28 31 24 38 32 59 GAG 13 14 5 18 9 11 15 14 20 GGT 11 12 12 14 30 2 17 15 43 GGC 4 12 5 7 7 6 11 4 7 GGA 7 18 13 7 2 8 5 10 6 GGG 6 5 4 4 1 3 1 8 1 CAT 9 25 5 10 2 9 15 9 13 CAC 7 9 3 2 4 5 1 4 7 ATT 9 29 13 18 20 16 29 22 44 ATC 8 20 11 13 15 8 19 10 20 ATA 18 23 11 12 4 11 3 12 3 TTA 15 34 16 16 14 9 25 16 34 TTG 22 26 16 20 18 12 28 23 46 CTT 10 16 6 4 4 8 3 4 7 CTC 1 10 4 6 1 4 0 2 1 CTA 10 23 8 8 6 6 8 7 7 CTG 7 10 5 8 1 4 2 6 4 AAA 28 50 23 37 25 26 40 29 50 AAG 23 29 11 24 29 14 37 17 43 ATG 12 15 7 15 12 14 12 18 18 TTT 21 25 15 31 10 13 23 24 22 TTC 5 13 7 8 10 6 15 15 31 CCT 12 11 6 8 7 6 9 8 14 CCC 3 9 5 4 1 4 5 4 2 CCA 9 13 5 18 7 7 13 8 28 CCG 2 8 0 4 0 3 3 5 1 TCT 17 14 8 11 21 9 14 5 26 TCC 3 15 6 6 8 4 16 7 21 TCA 6 20 11 9 9 14 9 10 12 TCG 6 6 4 4 2 0 4 11 1 AGT 3 11 11 12 5 3 6 6 8 AGC 4 13 3 3 1 3 5 1 3 TAA 1 0 1 0 1 0 0 1 0 TAG 0 0 0 0 0 1 1 0 0 TGA 0 1 0 1 0 0 0 0 1 ACT 5 17 9 7 14 9 19 16 25 ACC 7 11 1 8 5 7 11 5 17 ACA 5 16 9 10 7 9 8 10 12 ACG 7 8 6 5 2 4 5 7 4 TGG 5 18 3 5 4 10 14 6 22 TAT 15 25 12 13 10 10 9 5 25 TAC 5 17 7 9 7 5 12 8 22 GTT 6 19 9 12 19 10 19 10 44 GTC 6 9 4 5 10 4 9 6 24 GTA 4 8 10 8 2 11 3 9 5 GTG 2 9 10 11 4 5 8 10 11 YBR121C YDR023W YDR037W YDR341C YER087W YFL022C YGL245W YGR185C YGR264C GCT 25 16 21 18 10 10 35 11 22 GCC 17 6 14 10 3 12 13 9 11 GCA 7 1 1 11 6 4 3 6 13 GCG 0 1 1 4 5 1 1 5 1 CGT 5 4 9 7 4 4 10 0 10 CGC 2 0 1 1 2 0 0 0 1 CGA 0 0 0 0 3 0 0 0 0 CGG 0 0 0 0 1 0 0 0 0 AGA 26 12 23 19 12 15 23 8 12 AGG 3 1 2 1 6 0 3 2 1 AAT 13 11 10 13 24 9 15 9 30 AAC 10 12 11 13 11 17 21 12 24 GAT 29 17 24 22 31 15 43 10 30 GAC 20 7 17 12 10 20 21 8 15 TGT 6 5 8 2 11 1 6 3 10 TGC 0 3 1 1 4 0 1 1 0 CAA 15 17 24 20 11 20 16 15 24 CAG 1 4 2 4 11 5 0 2 3 GAA 52 40 46 36 27 26 44 23 44 GAG 9 11 9 14 10 12 2 7 7 GGT 30 21 29 28 14 21 24 17 29 GGC 5 2 2 7 8 2 6 4 2 GGA 4 3 1 3 11 1 6 1 5 GGG 2 0 1 0 3 4 1 1 1 CAT 12 5 7 7 8 4 4 3 17 CAC 3 4 9 7 5 8 10 2 5 ATT 21 12 17 22 13 9 28 9 23 ATC 14 13 10 18 11 17 18 12 15 ATA 2 1 1 1 14 1 4 0 3 TTA 18 17 12 24 17 7 19 10 22 TTG 32 17 27 18 15 23 32 19 34 CTT 3 2 5 6 5 9 1 4 4 CTC 0 1 1 1 2 4 1 2 1 CTA 2 4 5 6 6 7 7 5 8 CTG 1 0 2 6 11 8 1 1 6 AAA 30 24 23 29 35 20 27 21 34 AAG 30 26 25 22 15 21 49 21 28 ATG 12 6 20 19 16 14 17 9 10 TTT 22 7 13 15 18 7 8 12 18 TTC 11 13 17 14 5 19 21 8 14 CCT 7 3 7 5 6 8 8 6 9 CCC 0 1 0 3 4 4 2 2 1 CCA 23 15 23 11 9 8 20 17 24 CCG 0 0 3 1 1 0 0 1 0 TCT 19 12 11 15 5 11 13 5 22 TCC 11 10 7 5 4 12 6 5 7 TCA 4 3 3 5 14 3 5 3 10 TCG 0 0 1 3 6 4 1 1 5 AGT 5 3 0 1 11 0 2 3 7 AGC 0 1 1 2 5 1 3 2 3 TAA 1 1 1 1 0 1 1 1 1 TAG 0 0 0 0 1 0 0 0 0 TGA 0 0 0 0 0 0 0 0 0 ACT 13 7 12 11 8 5 20 5 11 ACC 9 4 10 5 4 16 13 8 2 ACA 4 1 7 8 8 6 2 2 12 ACG 2 1 0 1 2 3 2 2 7 TGG 7 6 2 9 10 6 12 1 13 TAT 10 8 7 13 8 3 8 7 20 TAC 8 13 13 11 10 12 15 6 15 GTT 33 15 15 24 10 9 22 14 32 GTC 17 8 14 8 7 12 22 8 7 GTA 1 4 3 3 6 0 1 1 1 GTG 0 1 1 2 4 3 6 3 6 YHR019C YIL078W YLR060W YOL097C YOR335C YPL160W YHR020W YOR168W YLL018C GCT 20 17 16 6 39 43 25 20 21 GCC 12 17 16 7 19 24 17 7 14 GCA 9 3 3 7 8 24 7 15 8 GCG 0 2 2 2 2 6 0 6 0 CGT 9 10 7 4 12 15 5 3 10 CGC 1 0 0 1 1 1 2 0 1 CGA 0 0 0 0 0 0 0 0 0 CGG 0 0 0 0 0 0 0 0 0 AGA 17 27 17 10 20 20 26 14 19 AGG 0 2 1 1 2 5 3 5 6 AAT 4 12 14 7 27 18 13 15 4 AAC 8 20 18 4 23 21 10 12 12 GAT 11 30 22 20 49 50 29 16 10 GAC 26 14 18 15 24 14 20 9 23 TGT 8 9 8 5 6 11 6 7 3 TGC 1 3 1 1 1 2 0 2 0 CAA 20 23 15 19 23 31 15 14 18 CAG 4 4 3 3 3 6 1 1 5 GAA 34 56 31 22 66 81 52 29 43 GAG 10 8 16 6 12 18 9 8 14 GGT 27 31 18 17 60 42 30 17 27 GGC 6 5 6 4 10 9 5 3 1 GGA 3 6 0 2 3 3 4 13 0 GGG 1 5 4 2 3 6 2 3 4 CAT 8 13 7 7 11 12 12 9 4 CAC 2 6 8 2 5 8 3 5 8 ATT 13 21 20 11 29 46 21 24 16 ATC 14 13 19 6 24 22 14 11 12 ATA 1 1 4 2 3 6 2 9 0 TTA 7 21 15 7 20 28 18 13 6 TTG 35 31 25 16 38 30 32 21 36 CTT 1 1 5 3 8 5 3 8 3 CTC 2 0 0 0 1 1 0 1 2 CTA 5 6 8 4 6 9 2 9 7 CTG 4 3 2 3 6 4 1 4 2 AAA 13 32 23 18 39 47 30 24 16 AAG 30 33 23 26 52 53 30 15 32 ATG 11 22 13 8 10 27 12 16 11 TTT 7 18 13 16 26 30 22 10 12 TTC 15 21 16 19 27 29 11 5 16 CCT 3 4 7 7 11 19 7 11 7 CCC 2 0 0 1 4 1 0 3 5 CCA 17 22 21 12 22 29 23 15 14 CCG 0 2 2 1 1 3 0 3 0 TCT 13 28 11 3 25 28 19 16 7 TCC 13 7 13 9 11 6 11 9 10 TCA 3 3 5 4 8 12 4 6 2 TCG 1 2 4 2 1 2 0 1 1 AGT 2 6 2 1 3 3 5 5 5 AGC 3 1 3 5 2 5 0 2 3 TAA 0 1 1 1 1 1 1 1 0 TAG 0 0 0 0 0 0 0 0 0 TGA 1 0 0 0 0 0 0 0 1 ACT 12 18 9 9 26 23 13 9 5 ACC 17 10 14 10 13 15 9 4 13 ACA 5 2 4 6 8 13 4 12 6 ACG 2 0 3 2 1 6 2 6 1 TGG 4 13 4 3 8 13 7 1 1 TAT 10 8 4 3 13 26 10 9 6 TAC 13 16 13 9 22 26 8 7 12 GTT 13 24 17 12 36 25 33 18 11 GTC 15 18 12 8 16 17 17 11 11 GTA 4 3 6 5 3 8 1 10 4 GTG 3 1 4 7 6 3 0 10 7 > dudi.coa(aminoacyl$usage.codon, scannf = FALSE) Duality diagramm class: coa dudi $call: dudi.coa(df = aminoacyl$usage.codon, scannf = FALSE) $nf: 2 axis-components saved $rank: 34 eigen values: 0.07774 0.01301 0.008387 0.007261 0.006383 ... vector length mode content 1 $cw 36 numeric column weights 2 $lw 64 numeric row weights 3 $eig 34 numeric eigen values data.frame nrow ncol content 1 $tab 64 36 modified array 2 $li 64 2 row coordinates 3 $l1 64 2 row normed scores 4 $co 36 2 column coordinates 5 $c1 36 2 column normed scores other elements: N > > > > cleanEx(); ..nameEx <- "amova" > > ### * amova > > flush(stderr()); flush(stdout()) > > ### Name: amova > ### Title: Analysis of molecular variance > ### Aliases: amova print.amova > ### Keywords: multivariate > > ### ** Examples > > data(humDNAm) > amovahum <- amova(humDNAm$samples, sqrt(humDNAm$distances), humDNAm$structures) > amovahum $call amova(samples = humDNAm$samples, distances = sqrt(humDNAm$distances), structures = humDNAm$structures) $results Df Sum Sq Mean Sq Between regions 4 78.238115 19.5595288 Between samples Within regions 5 9.284744 1.8569488 Within samples 662 316.197379 0.4776395 Total 671 403.720238 0.6016695 $componentsofcovariance Sigma % Variations Between regions 0.13380659 21.119144 Variations Between samples Within regions 0.02213345 3.493396 Variations Within samples 0.47763955 75.387459 Total variations 0.63357958 100.000000 $statphi Phi Phi-samples-total 0.2461254 Phi-samples-regions 0.0442870 Phi-regions-total 0.2111914 > > > > cleanEx(); ..nameEx <- "apis108" > > ### * apis108 > > flush(stderr()); flush(stdout()) > > ### Name: apis108 > ### Title: Allelic frequencies in ten honeybees populations at eight > ### microsatellites loci > ### Aliases: apis108 > ### Keywords: datasets > > ### ** Examples > > data(apis108) > apis <- count2genet(as.data.frame(t(apis108))) > apis.pca <- dudi.pca(apis$tab, center = apis$center, + scale = FALSE, scannf = FALSE, nf = 3) > > > > cleanEx(); ..nameEx <- "ardeche" > > ### * ardeche > > flush(stderr()); flush(stdout()) > > ### Name: ardeche > ### Title: Fauna Table with double (row and column) partitioning > ### Aliases: ardeche > ### Keywords: datasets > > ### ** Examples > > data(ardeche) > dudi1 <- dudi.coa(ardeche$tab, scan = FALSE) > s.class(dudi1$co, ardeche$dat.fac) > s.label(dudi1$co, clab = 0.5, add.p = TRUE) > > > > cleanEx(); ..nameEx <- "area.plot" > > ### * area.plot > > flush(stderr()); flush(stdout()) > > ### Name: area.plot > ### Title: Graphical Display of Areas > ### Aliases: area.plot poly2area area2poly area2link area.util.contour > ### area.util.xy area.util.class > ### Keywords: hplot > > ### ** Examples > > data(elec88) > par(mfrow = c(2,2)) > area.plot(elec88$area, cpoint = 1) > area.plot(elec88$area, lab = elec88$lab, clab = 0.75) > area.plot(elec88$area, clab = 0.75) > # elec88$neig <- neig(area = elec88$area) > area.plot(elec88$area, graph = elec88$neig, + sub = "Neighbourhood graph", possub = "topright") > par(mfrow = c(1,1)) > > ## Not run: > ##D par(mfrow = c(3,3)) > ##D for (i in 1:9) { > ##D x <- elec88$tab[,i] > ##D area.plot(elec88$area, val=x, > ##D sub = names(elec88$tab)[i], csub = 3, cleg = 1.5) > ##D } > ##D > ##D par(mfrow = c(3,3)) > ##D for (i in 1:9) { > ##D x <- elec88$tab[,i] > ##D s.value(elec88$xy, elec88$tab[,i], contour = elec88$contour, > ##D meth = "greylevel", sub = names(elec88$tab)[i], csub = 3, > ##D cleg = 1.5, incl = FALSE) > ##D } > ##D > ##D data(irishdata) > ##D par(mfrow = c(2,2)) > ##D w <- area.util.contour(irishdata$area) > ##D xy <- area.util.xy(irishdata$area) > ##D area.plot(irishdata$area, cpoint = 1) > ##D apply(w, 1, function(x) segments(x[1],x[2],x[3],x[4], lwd = 3)) > ##D area.plot(irishdata$area, clabel = 1) > ##D s.label(xy, area = irishdata$area, incl = FALSE, clab = 0, > ##D cpoi = 3, addax = FALSE, contour = w) > ##D s.label(xy, area = irishdata$area, incl = FALSE, > ##D addax = FALSE, contour = w) > ##D if (require(maptools, quiet = TRUE) & require(spdep, quiet = TRUE)) { > ##D data(columbus) > ##D par(mfrow = c(2,2)) > ##D plot(col.gal.nb, coords, pch = 20, cex = 2) > ##D col.gal.neig <- nb2neig(col.gal.nb) > ##D s.label(data.frame(coords), neig = col.gal.neig, > ##D inc = FALSE, addax = FALSE, clab = 0, cneig = 1, cpo = 2) > ##D plot.polylist(polys,bbs) > ##D area.plot(poly2area(polys)) > ##D > ##D # 1 > ##D crime.f <- as.ordered(cut(columbus$CRIME, > ##D breaks = quantile(columbus$CRIME, probs = seq(0,1,0.2)), > ##D include.lowest = TRUE)) > ##D colours <- c("salmon1", "salmon2", "red3", "brown", "black") > ##D plot(bbs[,1], bbs[,4], xlab = "", ylab = "", asp = 1, type = "n", > ##D xlim = range(c(bbs[,1], bbs[,3])), ylim = range(c(bbs[,2], > ##D bbs[,4]))) > ##D for (i in 1:length(polys)) > ##D polygon(polys[[i]], col = colours[unclass(crime.f[i])]) > ##D legend(x = c(6, 7.75), y = c(13.5, 15), legend = levels(crime.f), > ##D fill = colours, cex = 0.7) > ##D title(sub = paste("Columbus OH: residential burglaries and ", > ##D "vehicle\nthefts", "per thousand households, 1980")) > ##D > ##D # 2 > ##D area1 <- poly2area(polys) > ##D w <- area.util.contour(area1) > ##D wxy <- area.util.xy(area1) > ##D area.plot(area1, values = columbus$CRIME, sub = paste("Columbus ", > ##D "OH: residential burglaries and vehicle\nthefts", > ##D "per thousand households, 1980")) > ##D apply(w, 1, function(x) segments(x[1], x[2], x[3], x[4], lwd = 2)) > ##D > ##D # 3 > ##D data(elec88) > ##D fr.area <- elec88$area > ##D fr.xy <- area.util.xy(fr.area) > ##D fr.neig <- elec88$neig # neig(area = fr.area) > ##D > ##D # 4 > ##D fr.poly <- area2poly(fr.area) > ##D fr.nb <- neig2nb(fr.neig) > ##D plot.polylist(fr.poly, attr(fr.poly, "region.rect"), border = "grey") > ##D plot(fr.nb, fr.xy, add = TRUE) > ##D s.label(fr.xy, clab = 0, area = fr.area, neig = fr.neig, > ##D cneig = 1, cpo = 2, inc = FALSE, addax = FALSE) > ##D par(mfrow=c(1,1)) > ##D } > ## End(Not run) > > data(irishdata) > w <- irishdata$area[c(42:53,18:25),] > w poly x y 42 S07 16 50 43 S07 16 44 44 S07 44 47 45 S07 21 34 46 S07 20 20 47 S07 28 19 48 S07 46 23 49 S07 30 8 50 S07 45 12 51 S07 68 35 52 S07 68 59 53 S07 63 78 18 S04 68 35 19 S04 68 59 20 S04 112 55 21 S04 119 50 22 S04 132 25 23 S04 74 0 24 S04 45 0 25 S04 45 12 > w$poly <- as.factor(as.character(w$poly)) > area.plot(w, clab = 2) > > points(68, 59, pch = 20, col = "red", cex = 3) > points(68, 35, pch = 20, col = "red", cex = 3) > points(45, 12, pch = 20, col = "red", cex = 3) > sqrt((59-35)^2)+sqrt((68-45)^2+(35-12)^2) [1] 56.52691 > area2link(w) S07 S04 S07 0.00000 56.52691 S04 56.52691 0.00000 > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "arrival" > > ### * arrival > > flush(stderr()); flush(stdout()) > > ### Name: arrival > ### Title: Arrivals at an intensive care unit > ### Aliases: arrival > ### Keywords: datasets chron > > ### ** Examples > > data(arrival) > dotcircle(arrival$hours, pi/2 + pi/12) > > > > cleanEx(); ..nameEx <- "as.taxo" > > ### * as.taxo > > flush(stderr()); flush(stdout()) > > ### Name: as.taxo > ### Title: Taxonomy > ### Aliases: as.taxo > ### Keywords: manip > > ### ** Examples > > data(taxo.eg) > tax <- as.taxo(taxo.eg[[1]]) > tax.phy <- taxo2phylog(as.taxo(taxo.eg[[1]])) > par(mfrow = c(1,2)) > plot.phylog(tax.phy, clabel.l = 1.25, clabel.n = 1.25, f = 0.75) > plot.phylog(taxo2phylog(as.taxo(taxo.eg[[1]][sample(15),])), + clabel.l = 1.25, clabel.n = 1.25, f = 0.75) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "atlas" > > ### * atlas > > flush(stderr()); flush(stdout()) > > ### Name: atlas > ### Title: Small Ecological Dataset > ### Aliases: atlas > ### Keywords: datasets > > ### ** Examples > > data(atlas) > op <- par(no.readonly = TRUE) > par(mfrow = c(2,2)) > area.plot(atlas$area, cpoin = 1.5) > area.plot(atlas$area, lab = atlas$names.district, clab = 1) > x <- atlas$meteo$mini.jan > > names(x) <- row.names(atlas$meteo) > area.plot(atlas$area, val = x, ncl = 12, sub = "Temp Mini January", + csub = 2, cleg = 1) > s.corcircle((dudi.pca(atlas$meteo, scann = FALSE)$co), + clab = 1) > > area.plot(atlas$area, val = dudi.pca(atlas$meteo,scann=FALSE)$li[,1], + ncl = 12, sub = "Principal Component Analysis analysis", csub = 1.5, + cleg = 1) > birds.coa <- dudi.coa(atlas$birds, sca = FALSE, nf = 1) > x <- birds.coa$li$Axis1 > area.plot(atlas$area, val = x, ncl = 12, + sub = "Correspondence analysis", csub = 1.5, cleg = 1) > > s.value(atlas$xy, x, contour = atlas$contour, csi = 2, + incl = FALSE, addax = FALSE) > triangle.plot(atlas$alti) > par(op) > par(mfrow=c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "atya" > > ### * atya > > flush(stderr()); flush(stdout()) > > ### Name: atya > ### Title: Genetic variability of Cacadors > ### Aliases: atya > ### Keywords: datasets > > ### ** Examples > > ## Not run: > ##D data(atya) > ##D if (require(pixmap, quiet = TRUE)) { > ##D atya.digi <- read.pnm(system.file("pictures/atyadigi.pnm", > ##D package = "ade4")) > ##D atya.carto <- read.pnm(system.file("pictures/atyacarto.pnm", > ##D package = "ade4")) > ##D par(mfrow = c(1,2)) > ##D plot(atya.digi) > ##D plot(atya.carto) > ##D points(atya$xy, pch = 20, cex = 2) > ##D } > ##D if (require(maptools, quiet = TRUE) & require(spdep, quiet = TRUE)) { > ##D plot(neig2nb(atya$neig), atya$xy, col = "red", add = TRUE, lwd = 2) > ##D par(mfrow = c(1,1)) > ##D } > ## End(Not run) > > > cleanEx(); ..nameEx <- "avijons" > > ### * avijons > > flush(stderr()); flush(stdout()) > > ### Name: avijons > ### Title: Bird species distribution > ### Aliases: avijons > ### Keywords: datasets > > ### ** Examples > > data(avijons) > w1=dudi.coa(avijons$fau,scannf=FALSE)$li > area.plot(avijons$area,center=avijons$xy,val=w1[,1],clab=0.75,sub="CA Axis 1",csub=3) > ## Not run: > ##D data(avijons) > ##D if (require(pixmap,quiet=TRUE)) { > ##D pnm.eau <- read.pnm(system.file("pictures/avijonseau.pnm", > ##D package = "ade4")) > ##D pnm.rou <- read.pnm(system.file("pictures/avijonsrou.pnm", > ##D package = "ade4")) > ##D pnm.veg <- read.pnm(system.file("pictures/avijonsveg.pnm", > ##D package = "ade4")) > ##D pnm.vil <- read.pnm(system.file("pictures/avijonsvil.pnm", > ##D package = "ade4")) > ##D jons.coa <- dudi.coa(avijons$fau, scan = FALSE, nf = 4) > ##D par(mfcol = c(3,2)) > ##D s.value(avijons$xy, jons.coa$li[,1], pixmap = pnm.rou, inclu = FALSE, > ##D grid = FALSE, addax = FALSE, cleg = 0, sub = "F1+ROADS", csub = 3) > ##D s.value(avijons$xy, jons.coa$li[,1], pixmap = pnm.veg, inclu = FALSE, > ##D grid = FALSE, addax = FALSE, cleg = 0, sub = "F1+TREES", csub = 3) > ##D s.value(avijons$xy, jons.coa$li[,1], pixmap = pnm.eau, inclu = FALSE, > ##D grid = FALSE, addax = FALSE, cleg = 0, sub = "F1+WATER", csub = 3) > ##D s.value(avijons$xy, jons.coa$li[,2], pixmap = pnm.rou, inclu = FALSE, > ##D grid = FALSE, addax = FALSE, cleg = 0, sub = "F2+ROADS", csub = 3) > ##D s.value(avijons$xy, jons.coa$li[,2], pixmap = pnm.veg, inclu = FALSE, > ##D grid = FALSE, addax = FALSE, cleg = 0, sub = "F2+TREES", csub = 3) > ##D s.value(avijons$xy, jons.coa$li[,2], pixmap = pnm.eau, inclu = FALSE, > ##D grid = FALSE, addax = FALSE, cleg = 0, sub = "F2+WATER", csub = 3) > ##D par(mfrow=c(1,1))} > ##D > ##D if (require(maptools, quiet = TRUE) & require(spdep, quiet = TRUE) > ##D & require( pixmap, quiet = TRUE) ) { > ##D link1 <- area2link(avijons$area) > ##D lw1 <- apply(link1,1,function(x) x[x>0]) > ##D neig1 <- neig(mat01=1*(link1>0)) > ##D nb1 <- neig2nb(neig1) > ##D listw1 <- nb2listw(nb1,lw1) > ##D jons.ms <- multispati(jons.coa, listw1, scan = FALSE, nfp = 3, > ##D nfn = 2) > ##D summary(jons.ms) > ##D par(mfrow = c(2,2)) > ##D barplot(jons.coa$eig) > ##D barplot(jons.ms$eig) > ##D s.corcircle(jons.ms$as) > ##D plot(jons.coa$li[,1], jons.ms$li[,1]) > ##D > ##D par(mfcol=c(3,2)) > ##D s.value(avijons$xy, jons.ms$li[,1], pixmap = pnm.rou, inclu = FALSE, > ##D grid = FALSE, addax = FALSE, cleg = 0, sub = "F1+ROADS", csub = 3) > ##D s.value(avijons$xy, jons.ms$li[,1], pixmap = pnm.veg, inclu = FALSE, > ##D grid = FALSE, addax = FALSE, cleg = 0, sub = "F1+TREES", csub = 3) > ##D s.value(avijons$xy, jons.ms$li[,1], pixmap = pnm.eau, inclu = FALSE, > ##D grid = FALSE, addax = FALSE, cleg = 0, sub = "F1+WATER", csub = 3) > ##D s.value(avijons$xy, jons.ms$li[,2], pixmap = pnm.rou, inclu = FALSE, > ##D grid = FALSE, addax = FALSE, cleg = 0, sub = "F2+ROADS", csub = 3) > ##D s.value(avijons$xy, jons.ms$li[,2], pixmap = pnm.veg, inclu = FALSE, > ##D grid = FALSE, addax = FALSE, cleg = 0, sub = "F2+TREES", csub = 3) > ##D s.value(avijons$xy, jons.ms$li[,2], pixmap = pnm.eau, inclu = FALSE, > ##D grid = FALSE, addax = FALSE, cleg = 0, sub = "F2+WATER", csub = 3) > ##D par(mfrow=c(1,1)) > ##D } > ## End(Not run) > > > cleanEx(); ..nameEx <- "avimedi" > > ### * avimedi > > flush(stderr()); flush(stdout()) > > ### Name: avimedi > ### Title: Fauna Table for Constrained Ordinations > ### Aliases: avimedi > ### Keywords: datasets > > ### ** Examples > > ## Not run: > ##D data(avimedi) > ##D par(mfrow = c(2,2)) > ##D coa1 <- dudi.coa(avimedi$fau, scan = FALSE, nf = 3) > ##D s.class(coa1$li,avimedi$plan$str:avimedi$plan$reg, > ##D sub = "Correspondences Analysis") > ##D bet1 <- between(coa1, avimedi$plan$str, scan = FALSE) > ##D s.class(bet1$ls, avimedi$plan$str, > ##D sub = "Between Analysis") > ##D wit1 <- within(coa1, avimedi$plan$reg, scan=FALSE) > ##D s.class(wit1$li, avimedi$plan$str, > ##D sub = "Within Analysis") > ##D pcaiv1 <- pcaiv(coa1, avimedi$plan, scan = FALSE) > ##D s.match(pcaiv1$li, pcaiv1$ls, clab = 0, > ##D sub = "Canonical Correspondences Analysis") > ##D s.class(pcaiv1$li, avimedi$plan$str:avimedi$plan$reg, > ##D add.plot = TRUE) > ##D par(mfrow=c(1,1)) > ## End(Not run) > > > cleanEx(); ..nameEx <- "aviurba" > > ### * aviurba > > flush(stderr()); flush(stdout()) > > ### Name: aviurba > ### Title: Ecological Tables Triplet > ### Aliases: aviurba > ### Keywords: datasets > > ### ** Examples > > data(aviurba) > a1 <- dudi.coa(aviurba$fau, scan = FALSE, nf=4) > a2 <- dudi.acm(aviurba$mil, row.w = a1$lw, scan = FALSE, nf = 4) > plot(coinertia(a1, a2, scan = FALSE)) > > > > cleanEx(); ..nameEx <- "bacteria" > > ### * bacteria > > flush(stderr()); flush(stdout()) > > ### Name: bacteria > ### Title: Genomes of 43 Bacteria > ### Aliases: bacteria > ### Keywords: datasets > > ### ** Examples > > data(bacteria) > names(bacteria$espcodon) [1] "GCT" "GCC" "GCA" "GCG" "CGT" "CGC" "CGA" "CGG" "AGA" "AGG" "AAT" "AAC" [13] "GAT" "GAC" "TGT" "TGC" "CAA" "CAG" "GAA" "GAG" "GGT" "GGC" "GGA" "GGG" [25] "CAT" "CAC" "ATT" "ATC" "ATA" "TTA" "TTG" "CTT" "CTC" "CTA" "CTG" "AAA" [37] "AAG" "ATG" "TTT" "TTC" "CCT" "CCC" "CCA" "CCG" "TCT" "TCC" "TCA" "TCG" [49] "AGT" "AGC" "TAA" "TAG" "TGA" "ACT" "ACC" "ACA" "ACG" "TGG" "TAT" "TAC" [61] "GTT" "GTC" "GTA" "GTG" > names(bacteria$espaa) [1] "Ala" "Arg" "Asn" "Asp" "Cys" "Gln" "Glu" "Gly" "His" "Ile" "Leu" "Lys" [13] "Met" "Phe" "Pro" "Ser" "Stp" "Thr" "Trp" "Tyr" "Val" > names(bacteria$espbase) [1] "A" "C" "G" "T" > sum(bacteria$espcodon) # 22,619,749 codons [1] 22619749 > scatter.coa(dudi.coa(bacteria$espcodon, scann = FALSE), + posi = "bottom") > > > > cleanEx(); ..nameEx <- "banque" > > ### * banque > > flush(stderr()); flush(stdout()) > > ### Name: banque > ### Title: Table of Factors > ### Aliases: banque > ### Keywords: datasets > > ### ** Examples > > data(banque) > banque.acm <- dudi.acm(banque, scann = FALSE, nf = 3) > apply(banque.acm$cr, 2, mean) RS1 RS2 RS3 0.17346599 0.11838319 0.09825814 > banque.acm$eig[1:banque.acm$nf] # the same thing [1] 0.17346599 0.11838319 0.09825814 > s.arrow(banque.acm$c1, clab = 0.75) > > > > cleanEx(); ..nameEx <- "baran95" > > ### * baran95 > > flush(stderr()); flush(stdout()) > > ### Name: baran95 > ### Title: African Estuary Fishes > ### Aliases: baran95 > ### Keywords: datasets > > ### ** Examples > > data(baran95) > w <- dudi.pca(log(baran95$fau+1), scal = FALSE, scann = FALSE, + nf = 3) > w1 <- within(w, baran95$plan$date, scann = FALSE) > fatala <- ktab.within(w1) > stat1 <- statis(fatala, scan = FALSE, nf = 3) > w1 <- split(stat1$C.Co, baran95$plan$date) > w2 <- split(baran95$plan$site, baran95$plan$date) > par(mfrow = c(3,2)) > for (j in 1:6) { + s.label(stat1$C.Co[,1:2], clab = 0, + sub = tab.names(fatala)[j], csub = 3) + s.class(w1[[j]][,1:2], w2[[j]], clab = 2, axese = FALSE, + add.plot = TRUE) + } > par(mfrow = c(1,1)) > > kplot(stat1, arrow = FALSE, traj = FALSE, clab = 2, uni = TRUE, + class = baran95$plan$site) #simpler > > mfa1 <- mfa(fatala, scan = FALSE, nf = 3) > w1 <- split(mfa1$co, baran95$plan$date) > w2 <- split(baran95$plan$site, baran95$plan$date) > par(mfrow = c(3,2)) > for (j in 1:6) { + s.label(mfa1$co[,1:2], clab = 0, + sub = tab.names(fatala)[j], csub = 3) + s.class(w1[[j]][,1:2], w2[[j]], clab = 2, axese=FALSE, + add.plot = TRUE) + } > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "between" > > ### * between > > flush(stderr()); flush(stdout()) > > ### Name: between > ### Title: Between-Class Analysis > ### Aliases: between print.between plot.between > ### Keywords: multivariate > > ### ** Examples > > data(meaudret) > par(mfrow = c(2,2)) > pca1 <- dudi.pca(meaudret$mil, scan = FALSE, nf = 4) > s.class(pca1$li, meaudret$plan$sta, + sub = "Principal Component Analysis (mil)", csub = 1.75) > pca2 <- dudi.pca(meaudret$fau, scal = FALSE, scan = FALSE, nf = 4) > s.class(pca2$li, meaudret$pla$sta, + sub = "Principal Component Analysis (fau)", csub = 1.75) > bet1 <- between(pca1, meaudret$plan$sta, scan = FALSE, nf = 2) > bet2 <- between(pca2, meaudret$plan$sta, scan = FALSE, nf = 2) > s.class(bet1$ls, meaudret$plan$sta, + sub = "Between sites PCA (mil)", csub = 1.75) > s.class(bet2$ls, meaudret$plan$sta, + sub = "Between sites PCA (fau)", csub = 1.75) > > par(mfrow = c(1,1)) > coib <- coinertia(bet1, bet2, scann = FALSE) > plot(coib) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "bf88" > > ### * bf88 > > flush(stderr()); flush(stdout()) > > ### Name: bf88 > ### Title: Cubic Ecological Data > ### Aliases: bf88 > ### Keywords: datasets > > ### ** Examples > > data(bf88) > fou1 <- foucart(bf88, scann = FALSE, nf = 3) > fou1 Foucart's COA class: foucart coa dudi $call: foucart(X = bf88, scannf = FALSE, nf = 3) table number: 6 $nf: 3 axis-components saved $rank: 3 eigen values: 0.5278 0.3591 0.3235 blo vector 6 blocks vector length mode content $cw 4 numeric column weights $lw 79 numeric row weights $eig 3 numeric eigen values data.frame nrow ncol content $tab 79 4 modified array $li 79 3 row coordinates $l1 79 3 row normed scores $co 4 3 column coordinates $c1 4 3 column normed scores **** Intrastructure **** data.frame nrow ncol content $Tli 474 3 row coordinates (each table) $Tco 24 3 col coordinates (each table) $TL 474 2 factors for Tli $TC 24 2 factors for Tco > par(mfrow = c(2,2)) > scatter(fou1) > s.traject(fou1$Tco, fou1$TC[,1]) > s.traject(fou1$Tco, fou1$TC[,2]) > s.label(fou1$Tco) > s.label(fou1$co, add.p = TRUE, clab = 2) > par(mfrow = c(1,1)) > kplot(fou1, clab.c = 2, clab.r = 0, csub = 3) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "bicenter.wt" > > ### * bicenter.wt > > flush(stderr()); flush(stdout()) > > ### Name: bicenter.wt > ### Title: Double Weighted Centring > ### Aliases: bicenter.wt > ### Keywords: utilities > > ### ** Examples > > w <- matrix(1:6, 3, 2) > bicenter.wt(w, c(0.2,0.6,0.2), c(0.3,0.7)) [,1] [,2] [1,] 0 0 [2,] 0 0 [3,] 0 0 > > w <- matrix(1:20, 5, 4) > sum(bicenter.wt(w, runif(5), runif(4))^2) [1] 4.042912e-29 > > > > cleanEx(); ..nameEx <- "bordeaux" > > ### * bordeaux > > flush(stderr()); flush(stdout()) > > ### Name: bordeaux > ### Title: Wine Tasting > ### Aliases: bordeaux > ### Keywords: datasets > > ### ** Examples > > data(bordeaux) > bordeaux excellent good mediocre boring Cru_Bourgeois 45 126 24 5 Grand_Cru_class\351 87 93 19 1 Vin_de_table 0 0 52 148 Bordeaux_d_origine 36 68 74 22 Vin_de_marque 0 30 111 59 > score(dudi.coa(bordeaux, scan = FALSE)) > > > > cleanEx(); ..nameEx <- "bsetal97" > > ### * bsetal97 > > flush(stderr()); flush(stdout()) > > ### Name: bsetal97 > ### Title: Ecological and Biological Traits > ### Aliases: bsetal97 > ### Keywords: datasets > > ### ** Examples > > data(bsetal97) > X <- prep.fuzzy.var(bsetal97$biol, bsetal97$biol.blo) 17 missing data found in block 1 14 missing data found in block 2 28 missing data found in block 3 8 missing data found in block 4 5 missing data found in block 5 19 missing data found in block 6 10 missing data found in block 7 5 missing data found in block 8 2 missing data found in block 9 12 missing data found in block 10 > Y <- prep.fuzzy.var(bsetal97$ecol, bsetal97$ecol.blo) 6 missing data found in block 1 16 missing data found in block 2 5 missing data found in block 3 9 missing data found in block 4 15 missing data found in block 5 47 missing data found in block 6 6 missing data found in block 7 > plot(coinertia(dudi.fca(X, scan = FALSE), + dudi.fca(Y, scan = FALSE), scan = FALSE)) > > > > cleanEx(); ..nameEx <- "buech" > > ### * buech > > flush(stderr()); flush(stdout()) > > ### Name: buech > ### Title: Buech basin > ### Aliases: buech > ### Keywords: datasets > > ### ** Examples > > data(buech) > par(mfrow = c(1,2)) > s.label(buech$xy, contour = buech$contour, neig = buech$neig) > s.value (buech$xy, buech$tab2$Suspens-buech$tab1$Suspens, + contour = buech$contour, neig = buech$neig, csi = 3) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "butterfly" > > ### * butterfly > > flush(stderr()); flush(stdout()) > > ### Name: butterfly > ### Title: Genetics-Ecology-Environment Triple > ### Aliases: butterfly > ### Keywords: datasets > > ### ** Examples > > data(butterfly) > par(mfrow = c(2,2)) > s.label(butterfly$xy, contour = butterfly$contour, inc = FALSE) > table.dist(dist(butterfly$xy), labels = row.names(butterfly$xy)) # depends of mva > s.value(butterfly$xy, dudi.pca(butterfly$envir, scan = FALSE)$li[,1], + contour = butterfly$contour, inc = FALSE, csi = 3) > plot(mantel.randtest(dist(butterfly$xy), dist(butterfly$gen), 99), + main = "genetic/spatial") > par(mfrow = c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "cailliez" > > ### * cailliez > > flush(stderr()); flush(stdout()) > > ### Name: cailliez > ### Title: Transformation to make Euclidean a distance matrix > ### Aliases: cailliez > ### Keywords: array > > ### ** Examples > > data(capitales) > d0 <- as.dist(capitales$df) > is.euclid(d0) # FALSE [1] FALSE > d1 <- cailliez(d0, TRUE) Cailliez constant = 2429.87867 > # Cailliez constant = 2429.87867 > is.euclid(d1) # TRUE [1] TRUE > plot(d0, d1) > abline(lm(unclass(d1)~unclass(d0))) > print(coefficients(lm(unclass(d1)~unclass(d0))), dig = 8) # d1 = d + Cte (Intercept) unclass(d0) 2429.8787 1.0000 > is.euclid(d0 + 2428) # FALSE [1] FALSE > is.euclid(d0 + 2430) # TRUE the smallest constant [1] TRUE > > > > cleanEx(); ..nameEx <- "capitales" > > ### * capitales > > flush(stderr()); flush(stdout()) > > ### Name: capitales > ### Title: Road Distances > ### Aliases: capitales > ### Keywords: datasets > > ### ** Examples > > if (require(pixmap, quiet = TRUE)) { + data(capitales) + names(capitales$df) + # [1] "Madrid" "Paris" "Londres" "Dublin" "Rome" + # [6] "Bruxelles" "Amsterdam" "Berlin" "Copenhague" "Stokholm" + #[11] "Luxembourg" "Helsinki" "Vienne" "Athenes" "Lisbonne" + + capitales.pnm <- read.pnm(system.file("pictures/capitales.pnm", package = "ade4")) + # plot(capitales.pnm) # depends of pixmap + # xy <- locator(15) # funny + data(capitales) + par(mfrow = c(2,2)) + s.label(capitales$xy, lab = names(capitales$df)) + s.label(capitales$xy, lab = names(capitales$df), pixmap = capitales.pnm, inc = FALSE) + table.dist(as.dist(capitales$df), lab = names(capitales$df)) # depends of mva + s.label(pcoscaled(lingoes(as.dist(capitales$df)))) + par(mfrow = c(1,1)) + } > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "carni19" > > ### * carni19 > > flush(stderr()); flush(stdout()) > > ### Name: carni19 > ### Title: Phylogeny and quantative trait of carnivora > ### Aliases: carni19 > ### Keywords: datasets > > ### ** Examples > > data(carni19) > carni19.phy <- newick2phylog(carni19$tre) > par(mfrow = c(1,2)) > symbols.phylog(carni19.phy,carni19$bm-mean(carni19$bm)) > dotchart.phylog(carni19.phy, carni19$bm, clabel.l=0.75) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "carni70" > > ### * carni70 > > flush(stderr()); flush(stdout()) > > ### Name: carni70 > ### Title: Phylogeny and quantitative traits of carnivora > ### Aliases: carni70 > ### Keywords: datasets > > ### ** Examples > > ## Not run: > ##D data(carni70) > ##D carni70.phy <- newick2phylog(carni70$tre) > ##D plot.phylog(carni70.phy) > ##D > ##D size <- scalewt(log(carni70$tab))[,1] > ##D names(size) <- row.names(carni70$tab) > ##D symbols.phylog(carni70.phy,size) > ##D orthogram(size, phylog = carni70.phy) > ##D > ##D yrange <- scalewt(carni70$tab[,2]) > ##D names(yrange) <- row.names(carni70$tab) > ##D symbols.phylog(carni70.phy,yrange) > ##D orthogram(yrange, phylog = carni70.phy) > ##D > ##D s.hist(cbind.data.frame(size, yrange), clabel = 0) > ## End(Not run) > > > cleanEx(); ..nameEx <- "carniherbi49" > > ### * carniherbi49 > > flush(stderr()); flush(stdout()) > > ### Name: carniherbi49 > ### Title: Taxonomy, phylogenies and quantitative traits of carnivora and > ### herbivora > ### Aliases: carniherbi49 > ### Keywords: datasets > > ### ** Examples > > ## Not run: > ##D data(carniherbi49) > ##D par(mfrow=c(1,3)) > ##D plot(newick2phylog(carniherbi49$tre1), clabel.leaves = 0, > ##D f.phylog = 2, sub ="article 1") > ##D plot(newick2phylog(carniherbi49$tre2), clabel.leaves = 0, > ##D f.phylog = 2, sub = "article 2") > ##D taxo <- as.taxo(carniherbi49$taxo) > ##D plot(taxo2phylog(taxo), clabel.nodes = 1.2, clabel.leaves = 1.2) > ##D par(mfrow = c(1,1)) > ## End(Not run) > > > cleanEx(); ..nameEx <- "casitas" > > ### * casitas > > flush(stderr()); flush(stdout()) > > ### Name: casitas > ### Title: Enzymatic polymorphism in Mus musculus > ### Aliases: casitas > ### Keywords: datasets > > ### ** Examples > > data(casitas) > casitas.pop <- as.factor(rep(c("dome", "cast", "musc", "casi"), c(24,11,9,30))) > table(casitas.pop,casitas[,1]) casitas.pop 080080 080100 100100 casi 2 11 17 cast 2 3 6 dome 0 0 24 musc 0 0 9 > casi.genet <- char2genet(casitas, casitas.pop) > names(casi.genet) [1] "tab" "center" "pop.names" "all.names" "loc.blocks" [6] "loc.fac" "loc.names" "pop.loc" "all.pop" > > > > cleanEx(); ..nameEx <- "cca" > > ### * cca > > flush(stderr()); flush(stdout()) > > ### Name: cca > ### Title: Canonical Correspondence Analysis > ### Aliases: cca > ### Keywords: multivariate > > ### ** Examples > > data(rpjdl) > millog <- log(rpjdl$mil + 1) > iv1 <- cca(rpjdl$fau, millog, scan = FALSE) > plot(iv1) > > # analysis with c1 - as - li -ls > # projections of inertia axes on PCAIV axes > s.corcircle(iv1$as) > > # Species positions > s.label(iv1$c1, 2, 1, clab = 0.5, xlim = c(-4,4)) > # Sites positions at the weighted mean of present species > s.label(iv1$ls, 2, 1, clab = 0, cpoi = 1, add.p = TRUE) > > # Prediction of the positions by regression on environmental variables > s.match(iv1$ls, iv1$li, 2, 1, clab = 0.5) > > # analysis with fa - l1 - co -cor > # canonical weights giving unit variance combinations > s.arrow(iv1$fa) > > # sites position by environmental variables combinations > # position of species by averaging > s.label(iv1$l1, 2, 1, clab = 0, cpoi = 1.5) > s.label(iv1$co, 2, 1, add.plot = TRUE) > > s.distri(iv1$l1, rpjdl$fau, 2, 1, cell = 0, csta = 0.33) > s.label(iv1$co, 2, 1, clab = 0.75, add.plot = TRUE) > > # coherence between weights and correlations > par(mfrow = c(1,2)) > s.corcircle(iv1$cor, 2, 1) > s.arrow(iv1$fa, 2, 1) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "chatcat" > > ### * chatcat > > flush(stderr()); flush(stdout()) > > ### Name: chatcat > ### Title: Qualitative Weighted Variables > ### Aliases: chatcat > ### Keywords: datasets > > ### ** Examples > > data(chatcat) > summary(chatcat$tab) age feco nport 1 :5 1-2 : 3 1: 9 2-3:6 3-6 :10 2:17 4-5:5 7-8 : 6 6-7:5 9-12 : 5 >=8:5 13-14: 2 > w <- acm.disjonctif(chatcat$tab) # Disjonctive table > names(w) <- c(paste("A", 1:5, sep = ""), paste("B", 1:5, sep = ""), + paste("C", 1:2, sep = "")) > w <- t(w*chatcat$num) > w <- data.frame(w) > w # BURT table X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 X16 X17 X18 X19 X20 X21 A1 7 0 0 18 0 0 0 0 5 0 0 0 0 0 1 0 0 0 0 1 0 A2 0 3 0 0 14 0 0 0 0 10 0 0 0 0 0 14 0 0 0 0 4 A3 0 0 0 0 0 3 0 0 0 0 1 0 0 1 0 0 7 0 0 0 0 A4 0 0 0 0 0 0 3 0 0 0 0 5 0 0 0 0 0 5 0 0 0 A5 0 0 2 0 0 0 0 3 0 0 0 0 3 0 0 0 0 0 5 0 0 B1 7 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 B2 0 0 0 18 14 3 3 3 5 10 1 5 3 0 0 0 0 0 0 0 0 B3 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 14 7 5 5 0 0 B4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 4 B5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C1 7 3 2 18 14 3 3 3 0 0 0 0 0 1 0 0 0 0 0 0 0 C2 0 0 0 0 0 0 0 0 5 10 1 5 3 0 1 14 7 5 5 1 4 X22 X23 X24 X25 X26 A1 0 0 0 0 0 A2 0 0 0 2 0 A3 6 0 0 0 0 A4 0 4 0 0 2 A5 0 0 5 0 0 B1 0 0 0 0 0 B2 0 0 0 0 0 B3 0 0 0 0 0 B4 6 4 5 0 0 B5 0 0 0 2 2 C1 0 0 0 0 0 C2 6 4 5 2 2 > > > > cleanEx(); ..nameEx <- "chats" > > ### * chats > > flush(stderr()); flush(stdout()) > > ### Name: chats > ### Title: Pair of Variables > ### Aliases: chats > ### Keywords: datasets > > ### ** Examples > > data(chats) > chatsw <- data.frame(t(chats)) > chatscoa <- dudi.coa(chatsw, scann = FALSE) > par(mfrow = c(2,2)) > table.cont(chatsw, abmean.x = TRUE, csi = 2, abline.x = TRUE, + clabel.r = 1.5, clabel.c = 1.5) > table.cont(chatsw, abmean.y = TRUE, csi = 2, abline.y = TRUE, + clabel.r = 1.5, clabel.c = 1.5) > table.cont(chatsw, x = chatscoa$c1[,1], y = chatscoa$l1[,1], + abmean.x = TRUE, csi = 2, abline.x = TRUE, clabel.r = 1.5, + clabel.c = 1.5) > table.cont(chatsw,, x = chatscoa$c1[,1], y = chatscoa$l1[,1], + abmean.y = TRUE, csi = 2, abline.y = TRUE, clabel.r = 1.5, + clabel.c = 1.5) > par(mfrow = c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "chazeb" > > ### * chazeb > > flush(stderr()); flush(stdout()) > > ### Name: chazeb > ### Title: Charolais-Zebus > ### Aliases: chazeb > ### Keywords: datasets > > ### ** Examples > > data(chazeb) > plot(discrimin(dudi.pca(chazeb$tab, scan = FALSE), + chazeb$cla, scan = FALSE)) > > > > cleanEx(); ..nameEx <- "chevaine" > > ### * chevaine > > flush(stderr()); flush(stdout()) > > ### Name: chevaine > ### Title: Enzymatic polymorphism in Leuciscus cephalus > ### Aliases: chevaine > ### Keywords: datasets > > ### ** Examples > > data(chevaine) > 'fun.chevaine' <- function(label=TRUE) { + opar <- par(mar = par("mar")) + on.exit(par(opar)) + par(mar = c(0.1, 0.1, 0.1, 0.1)) + s.label(chevaine$coo$poi, xlim = c(-20,400), clab = 0, cpoi = 0) + invisible(lapply(chevaine$coo$lac, polygon,col = "blue", type = "l", lwd = 2)) + invisible(lapply(chevaine$coo$riv, points, col = "blue", type = "l", lwd = 2)) + if (label){ + s.label(chevaine$coo$poi, clab = 0.75, add.p = TRUE) + s.label(chevaine$coo$sta, add.p = TRUE, clab = 0.5) + } + arrows(200,100,300,100, code = 3, angle = 15, length = 0.2) + text(250,125,"50 Km") + } > > fun.chevaine() > > che.genet <- freq2genet(chevaine$tab) > che.pca <- dudi.pca(che.genet$tab, center = che.genet$center, scannf = FALSE, nf = 3) > > par(mfrow = c(1,2)) > fun.chevaine(FALSE) > s.value(chevaine$coo$sta, che.pca$li[,1], csi = 2, add.p = TRUE) > fun.chevaine(FALSE) > s.value(chevaine$coo$sta, che.pca$li[,2], csi = 2, add.p = TRUE) > > w = prep.fuzzy.var (che.genet$tab, che.genet$loc.blocks) > che.fca <- dudi.fca(w, scannf = FALSE, nf = 3) > > fun.chevaine(FALSE) > s.value(chevaine$coo$sta, che.fca$li[,1], csi = 1.5, add.p = TRUE) > fun.chevaine(FALSE) > s.value(chevaine$coo$sta, che.fca$li[,2], csi = 1.5, add.p = TRUE) > > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "clementines" > > ### * clementines > > flush(stderr()); flush(stdout()) > > ### Name: clementines > ### Title: Fruit Production > ### Aliases: clementines > ### Keywords: datasets > > ### ** Examples > > data(clementines) > op <- par(no.readonly = TRUE) > par(mfrow = c(5,4)) ; par(mar = c(2,2,1,1)) > for (i in 1:20) { + w0 <- 1:15 ; plot(w0, clementines[,i], type = "b") + abline(lm(clementines[,i] ~ w0)) + } > par(op) > > pca1 <- dudi.pca(clementines, scan = FALSE) > s.corcircle(pca1$co, clab = 0.75) > > barplot(pca1$li[,1]) > > op <- par(no.readonly = TRUE) > par(mfrow = c(5,4)) ; par(mar = c(2,2,1,1)) > clem0 <- pca1$tab > croi <- 1:15 > alter <- c(rep(c(1,-1),7),1) > for (i in 1:20) { + y <- clem0[,i] + plot(w0, y, type = "b", ylim = c(-2,2)) + z <- predict(lm(clem0[,i] ~ croi*alter)) + points(w0, z, pch = 20, cex = 2) + for(j in 1:15) segments (j,y[j],j,z[j]) + } > par(op) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "cnc2003" > > ### * cnc2003 > > flush(stderr()); flush(stdout()) > > ### Name: cnc2003 > ### Title: Frequenting movie theaters in France in 2003 > ### Aliases: cnc2003 > ### Keywords: datasets > > ### ** Examples > > data(cnc2003) > sco.quant(cnc2003$popu, cnc2003[,2:10], abline = TRUE, csub = 3) > > > > cleanEx(); ..nameEx <- "coinertia" > > ### * coinertia > > flush(stderr()); flush(stdout()) > > ### Name: coinertia > ### Title: Coinertia Analysis > ### Aliases: coinertia print.coinertia plot.coinertia summary.coinertia > ### Keywords: multivariate > > ### ** Examples > > data(doubs) > dudi1 <- dudi.pca(doubs$mil, scale = TRUE, scan = FALSE, nf = 3) > dudi2 <- dudi.pca(doubs$poi, scale = FALSE, scan = FALSE, nf = 2) > coin1 <- coinertia(dudi1,dudi2, scan = FALSE, nf = 2) > s.arrow(coin1$l1, clab = 0.7) > > s.arrow(coin1$c1, clab = 0.7) > > par(mfrow = c(1,2)) > s.corcircle(coin1$aX) > s.corcircle(coin1$aY) > par(mfrow = c(1,1)) > > coin1 Coinertia analysis call: coinertia(dudiX = dudi1, dudiY = dudi2, scannf = FALSE, nf = 2) class: coinertia dudi $rank (rank) : 11 $nf (axis saved) : 2 $RV (RV coeff) : 0.4505569 eigen values: 119 13.87 0.7566 0.5278 0.2709 ... vector length mode content 1 $eig 11 numeric eigen values 2 $lw 27 numeric row weigths (crossed array) 3 $cw 11 numeric col weigths (crossed array) data.frame nrow ncol content 1 $tab 27 11 crossed array (CA) 2 $li 27 2 Y col = CA row: coordinates 3 $l1 27 2 Y col = CA row: normed scores 4 $co 11 2 X col = CA column: coordinates 5 $c1 11 2 X col = CA column: normed scores 6 $lX 30 2 row coordinates (X) 7 $mX 30 2 normed row scores (X) 8 $lY 30 2 row coordinates (Y) 9 $mY 30 2 normed row scores (Y) 10 $aX 3 2 axis onto co-inertia axis (X) 11 $aY 2 2 axis onto co-inertia axis (Y) > summary(coin1) Eigenvalues decomposition: eig covar sdX sdY corr 1 119.01942 10.909602 2.326324 6.422570 0.7301798 2 13.87137 3.724429 1.685078 2.863743 0.7718017 Inertia & coinertia X: inertia max ratio 1 5.411785 6.321624 0.8560752 12 8.251272 8.553220 0.9646978 Inertia & coinertia Y: inertia max ratio 1 41.24940 42.74627 0.9649824 12 49.45042 50.90461 0.9714331 RV: 0.4505569 > plot(coin1) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "coleo" > > ### * coleo > > flush(stderr()); flush(stdout()) > > ### Name: coleo > ### Title: Table of Fuzzy Biological Traits > ### Aliases: coleo > ### Keywords: datasets > > ### ** Examples > > data(coleo) > op <- par(no.readonly = TRUE) > coleo.fuzzy <- prep.fuzzy.var(coleo$tab, coleo$col.blocks) 2 missing data found in block 1 1 missing data found in block 3 2 missing data found in block 4 > fca1 <- dudi.fca(coleo.fuzzy, sca = FALSE, nf = 3) > par(mfrow = c(3,3)) > indica <- factor(rep(names(coleo$col), coleo$col)) > for (j in levels(indica)) s.distri (fca1$l1, + coleo$tab[,which(indica==j)], clab = 1.5, sub = as.character(j), + cell = 0, csta = 0.5, csub = 3, + label = coleo$moda.names[which(indica == j)]) > par(op) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "corkdist" > > ### * corkdist > > flush(stderr()); flush(stdout()) > > ### Name: corkdist > ### Title: Tests of randomization between distances applied to 'kdist' > ### objetcs > ### Aliases: corkdist mantelkdist RVkdist print.corkdist summary.corkdist > ### plot.corkdist > ### Keywords: nonparametric > > ### ** Examples > > data(friday87) > fri.w <- ktab.data.frame(friday87$fau, friday87$fau.blo, + tabnames = friday87$tab.names) > fri.kc <- lapply(1:10, function(x) dist.binary(fri.w[[x]],10)) > names(fri.kc) <- substr(friday87$tab.names,1,4) > fri.kd <- kdist(fri.kc) > fri.mantel = mantelkdist(kd = fri.kd, nrepet = 999) > plot(fri.mantel,1:5,1:5) > plot(fri.mantel,1:5,6:10) > plot(fri.mantel,6:10,1:5) > plot(fri.mantel,6:10,6:10) > s.corcircle (dudi.pca(as.data.frame(fri.kd), scan = FALSE)$co) > plot(RVkdist(fri.kd),1:5,1:5) > > data(yanomama) > m1 <- mantelkdist(kdist(yanomama),999) > m1 Mantel's tests for 'kdist' object class: corkdist list Call: mantelkdist(kd = kdist(yanomama), nrepet = 999) gen-geo Monte-Carlo test Observation: 0.5098684 Call: mantelkdist(kd = kdist(yanomama), nrepet = 999) Based on 999 replicates Simulated p-value: 0.003 ant-geo Monte-Carlo test Observation: 0.8428053 Call: mantelkdist(kd = kdist(yanomama), nrepet = 999) Based on 999 replicates Simulated p-value: 0.001 ant-gen Monte-Carlo test Observation: 0.2995506 Call: mantelkdist(kd = kdist(yanomama), nrepet = 999) Based on 999 replicates Simulated p-value: 0.052 list of 3 'randtest' objects > summary(m1) Mantel's tests for 'kdist' object Call: mantelkdist(kd = kdist(yanomama), nrepet = 999) Simulated p-values: 1 2 3 geo - - - gen 0.003 - - ant 0.001 0.052 - > plot(m1) > > > > cleanEx(); ..nameEx <- "corvus" > > ### * corvus > > flush(stderr()); flush(stdout()) > > ### Name: corvus > ### Title: Corvus morphology > ### Aliases: corvus > ### Keywords: datasets > > ### ** Examples > > data(corvus) > plot(corvus[,1:2]) > s.class(corvus[,1:2], corvus[,4]:corvus[,3], add.p = TRUE) > > > > cleanEx(); ..nameEx <- "deug" > > ### * deug > > flush(stderr()); flush(stdout()) > > ### Name: deug > ### Title: Exam marks for some students > ### Aliases: deug > ### Keywords: datasets > > ### ** Examples > > data(deug) > # decentred PCA > pca1 <- dudi.pca(deug$tab, scal = FALSE, center = deug$cent, + scan = FALSE) > s.class(pca1$li, deug$result) > s.arrow(40 * pca1$c1, add.plot = TRUE) > > > > cleanEx(); ..nameEx <- "disc" > > ### * disc > > flush(stderr()); flush(stdout()) > > ### Name: disc > ### Title: Rao's dissimilarity coefficient > ### Aliases: disc > ### Keywords: multivariate > > ### ** Examples > > data(humDNAm) > humDNA.dist <- disc(humDNAm$samples, sqrt(humDNAm$distances), humDNAm$structures) > humDNA.dist $samples oriental tharu wolof peul pima maya finnish tharu 0.2520200 wolof 0.7821356 0.7965116 peul 0.8506600 0.8632233 0.1251814 pima 0.1994968 0.2755218 0.7582823 0.8338317 maya 0.2559697 0.3023221 0.7177691 0.7857762 0.1406173 finnish 0.2455583 0.3043545 0.7615230 0.8367302 0.1416780 0.1899101 sicilian 0.2966927 0.3553515 0.7194281 0.7871977 0.2731589 0.2783955 0.2593187 israelij 0.3578283 0.4564520 0.7963554 0.8604647 0.3906841 0.4075339 0.3601095 israelia 0.4102655 0.4363589 0.5822519 0.6437361 0.3588124 0.3027937 0.2984287 sicilian israelij tharu wolof peul pima maya finnish sicilian israelij 0.3690240 israelia 0.3541134 0.3947386 $regions africa america asia europe america 0.7609083 asia 0.8016371 0.2280650 europe 0.7519837 0.1646208 0.2553667 middleeast 0.6866876 0.3045622 0.3592600 0.2518122 > is.euclid(humDNA.dist$samples) [1] TRUE > is.euclid(humDNA.dist$regions) [1] TRUE > > ## Not run: > ##D data(ecomor) > ##D ecomor.phylog <- taxo2phylog(ecomor$taxo) > ##D ecomor.dist <- disc(ecomor$habitat, ecomor.phylog$Wdist) > ##D ecomor.dist > ##D is.euclid(ecomor.dist) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "discrimin" > > ### * discrimin > > flush(stderr()); flush(stdout()) > > ### Name: discrimin > ### Title: Linear Discriminant Analysis (descriptive statistic) > ### Aliases: discrimin plot.discrimin print.discrimin > ### Keywords: multivariate > > ### ** Examples > > data(chazeb) > dis1 <- discrimin(dudi.pca(chazeb$tab, scan = FALSE), chazeb$cla, + scan = FALSE) > dis1 Discriminant analysis call: discrimin(dudi = dudi.pca(chazeb$tab, scan = FALSE), fac = chazeb$cla, scannf = FALSE) class: discrimin $nf (axis saved) : 1 eigen values: 0.8451 data.frame nrow ncol content 1 $fa 6 1 loadings / canonical weights 2 $li 23 1 canonical scores 3 $va 6 1 cos(variables, canonical scores) 4 $cp 6 1 cos(components, canonical scores) 5 $gc 2 1 class scores > plot(dis1) > > data(skulls) > plot(discrimin(dudi.pca(skulls, scan = FALSE), gl(5,30), + scan = FALSE)) > > > > cleanEx(); ..nameEx <- "discrimin.coa" > > ### * discrimin.coa > > flush(stderr()); flush(stdout()) > > ### Name: discrimin.coa > ### Title: Discriminant Correspondence Analysis > ### Aliases: discrimin.coa > ### Keywords: multivariate > > ### ** Examples > > data(perthi02) > plot(discrimin.coa(perthi02$tab, perthi02$cla, scan = FALSE)) > > > > cleanEx(); ..nameEx <- "dist.binary" > > ### * dist.binary > > flush(stderr()); flush(stdout()) > > ### Name: dist.binary > ### Title: Computation of Distance Matrices for Binary Data > ### Aliases: dist.binary > ### Keywords: array multivariate > > ### ** Examples > > data(aviurba) > for (i in 1:10) { + d <- dist.binary(aviurba$fau, method = i) + cat(attr(d, "method"), is.euclid(d), "\n")} JACCARD S3 TRUE SOCKAL & MICHENER S4 TRUE SOCKAL & SNEATH S5 TRUE ROGERS & TANIMOTO S6 TRUE CZEKANOWSKI S7 TRUE GOWER & LEGENDRE S9 TRUE OCHIAI S12 TRUE SOKAL & SNEATH S13 TRUE Phi of PEARSON S14 TRUE GOWER & LEGENDRE S2 TRUE > > > > cleanEx(); ..nameEx <- "dist.dudi" > > ### * dist.dudi > > flush(stderr()); flush(stdout()) > > ### Name: dist.dudi > ### Title: Computation of the Distance Matrix of a Statistical Triplet > ### Aliases: dist.dudi > ### Keywords: array multivariate > > ### ** Examples > > data (meaudret) > pca1 <- dudi.pca(meaudret$mil, scan = FALSE) > sum((dist(scalewt(meaudret$mil)) - dist.dudi(pca1))^2) [1] 1.386546e-28 > #[1] 4.045e-29 the same thing > > > > cleanEx(); ..nameEx <- "dist.genet" > > ### * dist.genet > > flush(stderr()); flush(stdout()) > > ### Name: dist.genet > ### Title: Genetic distances from gene frequencies > ### Aliases: dist.genet > ### Keywords: multivariate > > ### ** Examples > > data(casitas) > casi.genet <- char2genet(casitas, + as.factor(rep(c("dome", "cast", "musc", "casi"), c(24,11,9,30)))) > ldist <- lapply(1:5, function(method) dist.genet(casi.genet,method)) > ldist [[1]] casi cast dome cast 0.2863338 dome 0.1003991 0.3450556 musc 1.2185291 0.5636602 1.2472719 [[2]] casi cast dome cast 0.4378511 dome 0.3257588 0.5135286 musc 0.7565759 0.6318505 0.7946422 [[3]] casi cast dome cast 0.6596192 dome 0.6035993 0.7872298 musc 0.8571692 0.7891692 0.9215769 [[4]] casi cast dome cast 0.3413694 dome 0.1760324 0.3827603 musc 0.7016184 0.4739970 0.7222744 [[5]] casi cast dome cast 0.3547475 dome 0.1805556 0.3888889 musc 0.7347222 0.5104798 0.7416667 > unlist(lapply(ldist, is.euclid)) [1] FALSE TRUE TRUE TRUE TRUE > kdist(ldist) List of distances matrices call: kdist(ldist) class: kdist number of distances: 5 size: 4 labels: P1 P2 P3 P4 "casi" "cast" "dome" "musc" X1: non euclidean distance X2: euclidean distance X3: euclidean distance X4: euclidean distance X5: euclidean distance > > > > cleanEx(); ..nameEx <- "dist.neig" > > ### * dist.neig > > flush(stderr()); flush(stdout()) > > ### Name: dist.neig > ### Title: Computation of the Distance Matrix associated to a Neighbouring > ### Graph > ### Aliases: dist.neig > ### Keywords: array multivariate > > ### ** Examples > > data(elec88) > d0 <- dist.neig(elec88$neig) > plot(dist(elec88$xy),d0) > > > > cleanEx(); ..nameEx <- "dist.prop" > > ### * dist.prop > > flush(stderr()); flush(stdout()) > > ### Name: dist.prop > ### Title: Computation of Distance Matrices of Percentage Data > ### Aliases: dist.prop > ### Keywords: array multivariate > > ### ** Examples > > data(microsatt) > w <- microsatt$tab[1:microsatt$loci.eff[1]] > par(mfrow = c(2,2)) > scatter(dudi.pco(lingoes(dist.prop(w,1)), scann = FALSE)) > scatter(dudi.pco(lingoes(dist.prop(w,2)), scann = FALSE)) > scatter(dudi.pco(dist.prop(w,3), scann = FALSE)) > scatter(dudi.pco(lingoes(dist.prop(w,4)), scann = FALSE)) > par(mfrow = c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "dist.quant" > > ### * dist.quant > > flush(stderr()); flush(stdout()) > > ### Name: dist.quant > ### Title: Computation of Distance Matrices on Quantitative Variables > ### Aliases: dist.quant > ### Keywords: array multivariate > > ### ** Examples > > data(ecomor) > par(mfrow = c(2,2)) > scatter(dudi.pco(dist.quant(ecomor$morpho,3), scan = FALSE)) > scatter(dudi.pco(dist.quant(ecomor$morpho,2), scan = FALSE)) > scatter(dudi.pco(dist(scalewt(ecomor$morpho)), scan = FALSE)) > scatter(dudi.pco(dist.quant(ecomor$morpho,1), scan = FALSE)) > par(mfrow = c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "divc" > > ### * divc > > flush(stderr()); flush(stdout()) > > ### Name: divc > ### Title: Rao's diversity coefficient also called quadratic entropy > ### Aliases: divc > ### Keywords: multivariate > > ### ** Examples > > data(ecomor) > ecomor.phylog <- taxo2phylog(ecomor$taxo) > divc(ecomor$habitat, ecomor.phylog$Wdist) diversity Bu1 2.754458 Bu2 2.967895 Bu3 3.107200 Bu4 3.137755 Ca1 2.500000 Ca2 3.230769 Ca3 3.272727 Ca4 3.283203 Ch1 2.333333 Ch2 2.595041 Ch3 3.246528 Ch4 3.135734 Pr1 2.840000 Pr2 2.816327 Pr3 3.055556 Pr4 3.028355 > > data(humDNAm) > divc(humDNAm$samples, sqrt(humDNAm$distances)) diversity oriental 0.43100189 tharu 0.48255042 wolof 0.65884298 peul 0.55952920 pima 0.06198035 maya 0.17092768 finnish 0.33280992 sicilian 0.61913580 israelij 0.67061144 israelia 0.64036818 > > > > cleanEx(); ..nameEx <- "divcmax" > > ### * divcmax > > flush(stderr()); flush(stdout()) > > ### Name: divcmax > ### Title: Maximal value of Rao's diversity coefficient also called > ### quadratic entropy > ### Aliases: divcmax > ### Keywords: multivariate > > ### ** Examples > > par.safe <- par()$mar > data(elec88) > par(mar = c(0.1, 0.1, 0.1, 0.1)) > # Departments of France. > area.plot(elec88$area) > > # Dissimilarity matrix. > d0 <- dist(elec88$xy) > > # Frequency distribution maximizing spatial diversity in France > # according to Rao's quadratic entropy. > France.m <- divcmax(d0) > w0 <- France.m$vectors$num > v0 <- France.m$value > (1:94) [w0 > 0] [1] 6 28 66 > > # Smallest circle including all the 94 departments. > # The squared radius of that circle is the maximal value of the > # spatial diversity. > w1 = elec88$xy[c(6, 28, 66), ] > w.c = apply(w1 * w0[c(6, 28, 66)], 2, sum) > symbols(w.c[1], w.c[2], circles = sqrt(v0), inc = FALSE, add = TRUE) > s.value(elec88$xy, w0, add.plot = TRUE) > par(mar = par.safe) > > ## Not run: > ##D # Maximisation of Rao's diversity coefficient > ##D # with ultrametric dissimilarities. > ##D data(microsatt) > ##D mic.genet <- count2genet(microsatt$tab) > ##D mic.dist <- dist.genet(mic.genet, 1) > ##D mic.phylog <- hclust2phylog(hclust(mic.dist)) > ##D plot.phylog(mic.phylog) > ##D mic.maxpond <- divcmax(mic.phylog$Wdist)$vectors$num > ##D dotchart.phylog(mic.phylog, mic.maxpond) > ## End(Not run) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "dotcircle" > > ### * dotcircle > > flush(stderr()); flush(stdout()) > > ### Name: dotcircle > ### Title: Representation of n values on a circle > ### Aliases: dotcircle > ### Keywords: hplot > > ### ** Examples > > w <- scores.neig(neig(n.cir = 24)) > par(mfrow = c(4,4)) > for (k in 1:16) dotcircle(w[,k],labels = 1:24) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "doubs" > > ### * doubs > > flush(stderr()); flush(stdout()) > > ### Name: doubs > ### Title: Pair of Ecological Tables > ### Aliases: doubs > ### Keywords: datasets > > ### ** Examples > > data(doubs) > pca1 <- dudi.pca(doubs$mil, scan = FALSE) > pca2 <- dudi.pca(doubs$poi, scale = FALSE, scan = FALSE) > coiner1 <- coinertia(pca1, pca2, scan = FALSE) > par(mfrow = c(3,3)) > s.corcircle(coiner1$aX) > s.value(doubs$xy, coiner1$lX[,1]) > s.value(doubs$xy, coiner1$lX[,2]) > s.arrow(coiner1$c1) > s.match(coiner1$mX, coiner1$mY) > s.corcircle(coiner1$aY) > s.arrow(coiner1$l1) > s.value(doubs$xy, coiner1$lY[,1]) > s.value(doubs$xy, coiner1$lY[,2]) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "dpcoa" > > ### * dpcoa > > flush(stderr()); flush(stdout()) > > ### Name: dpcoa > ### Title: Double principal coordinate analysis > ### Aliases: dpcoa plot.dpcoa print.dpcoa > ### Keywords: multivariate > > ### ** Examples > > data(humDNAm) > dpcoahum <- dpcoa(humDNAm$samples, sqrt(humDNAm$distances), scan = FALSE, nf = 2) > dpcoahum double principal coordinate analysis class: dpcoa $call: dpcoa(df = humDNAm$samples, dis = sqrt(humDNAm$distances), scannf = FALSE, nf = 2) $nf: 2 axis-components saved eigen values: 0.1018 0.01035 0.006281 0.005602 0.003179 ... vector length mode content 1 $w1 56 numeric weights of species 2 $w2 10 numeric weights of communities 3 $eig 9 numeric eigen values 4 $RaoDiv 10 numeric diversity coefficients within communities dist Size content 1 $RaoDis 10 dissimilarities among communities data.frame nrow ncol content 1 $RaoDecodiv 3 1 decomposition of diversity 2 $l1 56 2 coordinates of the species 3 $l2 10 2 coordinates of the species 4 $c1 34 2 scores of the principal axes of the species > plot(dpcoahum, csize = 1.5) > ## Not run: > ##D data(ecomor) > ##D ecomor.phylog <- taxo2phylog(ecomor$taxo) > ##D dpcoaeco <- dpcoa(ecomor$habitat, ecomor.phylog$Wdist, scan = FALSE, nf = 2) > ##D dpcoaeco > ##D plot(dpcoaeco, csize = 1.5) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "dudi" > > ### * dudi > > flush(stderr()); flush(stdout()) > > ### Name: dudi > ### Title: Duality Diagram > ### Aliases: dudi as.dudi print.dudi t.dudi is.dudi redo.dudi > ### Keywords: multivariate > > ### ** Examples > > data(deug) > dd1 <- dudi.pca(deug$tab, scannf = FALSE) > dd1 Duality diagramm class: pca dudi $call: dudi.pca(df = deug$tab, scannf = FALSE) $nf: 2 axis-components saved $rank: 9 eigen values: 3.101 1.363 1.032 0.9341 0.7398 ... vector length mode content 1 $cw 9 numeric column weights 2 $lw 104 numeric row weights 3 $eig 9 numeric eigen values data.frame nrow ncol content 1 $tab 104 9 modified array 2 $li 104 2 row coordinates 3 $l1 104 2 row normed scores 4 $co 9 2 column coordinates 5 $c1 9 2 column normed scores other elements: cent norm > t(dd1) Duality diagramm class: transpo dudi $call: t.dudi(x = dd1) $nf: 2 axis-components saved $rank: 9 eigen values: 3.101 1.363 1.032 0.9341 0.7398 ... vector length mode content 1 $cw 104 numeric column weights 2 $lw 9 numeric row weights 3 $eig 9 numeric eigen values data.frame nrow ncol content 1 $tab 9 104 modified array 2 $li 9 2 row coordinates 3 $l1 9 2 row normed scores 4 $co 104 2 column coordinates 5 $c1 104 2 column normed scores other elements: NULL > is.dudi(dd1) [1] TRUE > redo.dudi(dd1,3) Duality diagramm class: pca dudi $call: dudi.pca(df = deug$tab, scannf = FALSE, nf = 3) $nf: 3 axis-components saved $rank: 9 eigen values: 3.101 1.363 1.032 0.9341 0.7398 ... vector length mode content 1 $cw 9 numeric column weights 2 $lw 104 numeric row weights 3 $eig 9 numeric eigen values data.frame nrow ncol content 1 $tab 104 9 modified array 2 $li 104 3 row coordinates 3 $l1 104 3 row normed scores 4 $co 9 3 column coordinates 5 $c1 9 3 column normed scores other elements: cent norm > > > > cleanEx(); ..nameEx <- "dudi.acm" > > ### * dudi.acm > > flush(stderr()); flush(stdout()) > > ### Name: dudi.acm > ### Title: Multiple Correspondence Analysis > ### Aliases: dudi.acm acm.burt acm.disjonctif boxplot.acm > ### Keywords: multivariate > > ### ** Examples > > data(ours) > summary(ours) altit deniv cloiso domain boise hetra favor inexp citat depart 1: 8 1:13 1:12 1: 9 1:10 1:19 1:15 1:20 1:22 AHP:5 2:17 2:14 2: 4 2:13 2:15 2: 5 2:12 2:10 2: 7 AM :4 3:13 3:11 3:22 3:16 3:13 3:14 3:11 3: 8 3: 4 D :5 4: 5 HP :8 HS :4 I :5 S :7 > boxplot(dudi.acm(ours, scan = FALSE)) > ## Not run: > ##D data(banque) > ##D banque.acm <- dudi.acm(banque, scann = FALSE, nf = 3) > ##D scatter.dudi(banque.acm) > ##D > ##D apply(banque.acm$cr, 2, mean) > ##D banque.acm$eig[1:banque.acm$nf] # the same thing > ##D boxplot.acm(banque.acm) > ##D > ##D scatter(banque.acm) > ##D > ##D s.value(banque.acm$li, banque.acm$li[,3]) > ##D > ##D bb <- acm.burt(banque, banque) > ##D bbcoa <- dudi.coa(bb, scann = FALSE) > ##D plot(banque.acm$c1[,1], bbcoa$c1[,1]) > ##D # mca and coa of Burt table. Lebart & coll. section 1.4 > ##D > ##D bd <- acm.disjonctif(banque) > ##D bdcoa <- dudi.coa(bd, scann = FALSE) > ##D plot(banque.acm$li[,1], bdcoa$li[,1]) > ##D # mca and coa of disjonctive table. Lebart & coll. section 1.4 > ##D plot(banque.acm$co[,1], dudi.coa(bd, scann = FALSE)$co[,1]) > ## End(Not run) > > > cleanEx(); ..nameEx <- "dudi.coa" > > ### * dudi.coa > > flush(stderr()); flush(stdout()) > > ### Name: dudi.coa > ### Title: Correspondence Analysis > ### Aliases: dudi.coa > ### Keywords: multivariate > > ### ** Examples > > data(rpjdl) > chisq.test(rpjdl$fau)$statistic Warning in chisq.test(rpjdl$fau) : Chi-squared approximation may be incorrect X-squared 7323.597 > rpjdl.coa <- dudi.coa(rpjdl$fau, scannf = FALSE, nf = 4) > sum(rpjdl.coa$eig)*rpjdl.coa$N # the same [1] 7323.597 > > par(mfrow = c(1,2)) > s.label(rpjdl.coa$co, clab = 0.6, lab = rpjdl$frlab) > s.label(rpjdl.coa$li, clab = 0.6) > par(mfrow = c(1,1)) > > data(bordeaux) > db <- dudi.coa(bordeaux, scan = FALSE) > db Duality diagramm class: coa dudi $call: dudi.coa(df = bordeaux, scannf = FALSE) $nf: 2 axis-components saved $rank: 3 eigen values: 0.5906 0.1102 0.03109 vector length mode content 1 $cw 4 numeric column weights 2 $lw 5 numeric row weights 3 $eig 3 numeric eigen values data.frame nrow ncol content 1 $tab 5 4 modified array 2 $li 5 2 row coordinates 3 $l1 5 2 row normed scores 4 $co 4 2 column coordinates 5 $c1 4 2 column normed scores other elements: N > score(db) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "dudi.dec" > > ### * dudi.dec > > flush(stderr()); flush(stdout()) > > ### Name: dudi.dec > ### Title: Decentred Correspondence Analysis > ### Aliases: dudi.dec > ### Keywords: multivariate > > ### ** Examples > > data(ichtyo) > dudi1 <- dudi.dec(ichtyo$tab, ichtyo$eff, scan = FALSE) > sum(apply(ichtyo$tab, 2, function(x) + chisq.test(x, p = ichtyo$eff/sum(ichtyo$eff))$statistic)) Warning in chisq.test(x, p = ichtyo$eff/sum(ichtyo$eff)) : Chi-squared approximation may be incorrect Warning in chisq.test(x, p = ichtyo$eff/sum(ichtyo$eff)) : Chi-squared approximation may be incorrect Warning in chisq.test(x, p = ichtyo$eff/sum(ichtyo$eff)) : Chi-squared approximation may be incorrect Warning in chisq.test(x, p = ichtyo$eff/sum(ichtyo$eff)) : Chi-squared approximation may be incorrect [1] 2851.051 > sum(dudi1$eig) * sum(ichtyo$eff) # the same [1] 2851.051 > > s.class(dudi1$li, ichtyo$dat, wt = ichtyo$eff/sum(ichtyo$eff)) > > > > cleanEx(); ..nameEx <- "dudi.fca" > > ### * dudi.fca > > flush(stderr()); flush(stdout()) > > ### Name: dudi.fca > ### Title: Fuzzy Correspondence Analysis > ### Aliases: dudi.fca prep.fuzzy.var > ### Keywords: multivariate > > ### ** Examples > > w1 <- matrix(c(1,0,0,2,1,1,0,2,2,0,1,0,1,1,1,0,1,3,1,0), 4, 5) > w1 <- data.frame(w1) > w2 <- prep.fuzzy.var(w1, c(2,3)) 1 missing data found in block 1 1 missing data found in block 2 > w1 X1 X2 X3 X4 X5 1 1 1 2 1 1 2 0 1 0 1 3 3 0 0 1 1 1 4 2 2 0 0 0 > w2 X1 X2 X3 X4 X5 1 0.5000000 0.5000000 0.5000000 0.2500000 0.2500000 2 0.0000000 1.0000000 0.0000000 0.2500000 0.7500000 3 0.3333333 0.6666667 0.3333333 0.3333333 0.3333333 4 0.5000000 0.5000000 0.2777778 0.2777778 0.4444444 > attributes(w2) $names [1] "X1" "X2" "X3" "X4" "X5" $row.names [1] "1" "2" "3" "4" $class [1] "data.frame" $col.blocks FV1 FV2 2 3 $row.w [1] 0.25 0.25 0.25 0.25 $col.freq [1] 0.3333333 0.6666667 0.2777778 0.2777778 0.4444444 $col.num [1] 1 1 2 2 2 Levels: 1 2 > > data(bsetal97) > w <- prep.fuzzy.var(bsetal97$biol, bsetal97$biol.blo) 17 missing data found in block 1 14 missing data found in block 2 28 missing data found in block 3 8 missing data found in block 4 5 missing data found in block 5 19 missing data found in block 6 10 missing data found in block 7 5 missing data found in block 8 2 missing data found in block 9 12 missing data found in block 10 > scatter(dudi.fca(w, scann = FALSE, nf = 3), csub = 3, clab.moda = 1.5) > > w1 <- prep.fuzzy.var(bsetal97$biol, bsetal97$biol.blo) 17 missing data found in block 1 14 missing data found in block 2 28 missing data found in block 3 8 missing data found in block 4 5 missing data found in block 5 19 missing data found in block 6 10 missing data found in block 7 5 missing data found in block 8 2 missing data found in block 9 12 missing data found in block 10 > w2 <- prep.fuzzy.var(bsetal97$ecol, bsetal97$ecol.blo) 6 missing data found in block 1 16 missing data found in block 2 5 missing data found in block 3 9 missing data found in block 4 15 missing data found in block 5 47 missing data found in block 6 6 missing data found in block 7 > d1 <- dudi.fca(w1, scann = FALSE, nf = 3) > d2 <- dudi.fca(w2, scann = FALSE, nf = 3) > plot(coinertia(d1, d2, scann = FALSE)) > > > > cleanEx(); ..nameEx <- "dudi.hillsmith" > > ### * dudi.hillsmith > > flush(stderr()); flush(stdout()) > > ### Name: dudi.hillsmith > ### Title: Ordination of Tables mixing quantitative variables and factors > ### Aliases: dudi.hillsmith > ### Keywords: multivariate > > ### ** Examples > > data(dunedata) > attributes(dunedata$envir$use)$class <- "factor" # use dudi.mix for ordered data > dd1 <- dudi.hillsmith(dunedata$envir, scann = FALSE) > scatter.dudi(dd1, clab.r = 1, clab.c = 1.5) > > > > cleanEx(); ..nameEx <- "dudi.mix" > > ### * dudi.mix > > flush(stderr()); flush(stdout()) > > ### Name: dudi.mix > ### Title: Ordination of Tables mixing quantitative variables and factors > ### Aliases: dudi.mix > ### Keywords: multivariate > > ### ** Examples > > data(dunedata) > dd1 <- dudi.mix(dunedata$envir, scann = FALSE) > scatter.dudi(dd1, clab.r = 1, clab.c = 1.5) > > dd2 <- dudi.mix(dunedata$envir, scann = FALSE, add = TRUE) > scatter.dudi(dd2, clab.r = 1, clab.c = 1.5) > > > > cleanEx(); ..nameEx <- "dudi.nsc" > > ### * dudi.nsc > > flush(stderr()); flush(stdout()) > > ### Name: dudi.nsc > ### Title: Non symmetric correspondence analysis > ### Aliases: dudi.nsc > ### Keywords: multivariate > > ### ** Examples > > data(housetasks) > nsc1 <- dudi.nsc(housetasks, scan = FALSE) > s.label(nsc1$c1, clab = 1.25) > s.arrow(nsc1$li, add.pl = TRUE, clab = 0.75) # see ref p.383 > > > > cleanEx(); ..nameEx <- "dudi.pca" > > ### * dudi.pca > > flush(stderr()); flush(stdout()) > > ### Name: dudi.pca > ### Title: Principal Component Analysis > ### Aliases: dudi.pca > ### Keywords: multivariate > > ### ** Examples > > data(deug) > deug.dudi <- dudi.pca(deug$tab, center = deug$cent, + scale = FALSE, scan = FALSE) > par(mfrow = c(2,2)) > s.class(deug.dudi$li, deug$result, cpoint = 1) > s.arrow(deug.dudi$c1, lab = names(deug$tab)) > deug.dudi1 <- dudi.pca(deug$tab, center = TRUE, + scale = TRUE, scan = FALSE) > s.class(deug.dudi1$li, deug$result, cpoint = 1) > s.corcircle(deug.dudi1$co, lab = names(deug$tab), + full = FALSE, box = TRUE) > par(mfrow = c(1,1)) > > # for interpretations > par(mfrow = c(3,3)) > par(mar = c(2.1,2.1,2.1,1.1)) > for(i in 1:9) { + hist(deug.dudi$tab[,i], xlim = c(-40,40), breaks = seq(-45, 35, by = 5), + prob = TRUE, right = FALSE, main = names(deug$tab)[i], xlab = "", + ylim = c(0,0.10)) + abline(v = 0, lwd = 3) + } > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "dudi.pco" > > ### * dudi.pco > > flush(stderr()); flush(stdout()) > > ### Name: dudi.pco > ### Title: Principal Coordinates Analysis > ### Aliases: dudi.pco scatter.pco > ### Keywords: array multivariate > > ### ** Examples > > data(yanomama) > gen <- quasieuclid(as.dist(yanomama$gen)) > geo <- quasieuclid(as.dist(yanomama$geo)) > ant <- quasieuclid(as.dist(yanomama$ant)) > geo1 <- dudi.pco(geo, scann = FALSE, nf = 3) > gen1 <- dudi.pco(gen, scann = FALSE, nf = 3) > ant1 <- dudi.pco(ant, scann = FALSE, nf = 3) > plot(coinertia(ant1, gen1, scann = FALSE)) > > > > cleanEx(); ..nameEx <- "dunedata" > > ### * dunedata > > flush(stderr()); flush(stdout()) > > ### Name: dunedata > ### Title: Dune Meadow Data > ### Aliases: dunedata > ### Keywords: datasets > > ### ** Examples > > data(dunedata) > summary(dunedata$envir) A1 moisture manure use management Min. : 2.800 Min. :1.0 Min. :0.00 hayfield:7 BF:3 1st Qu.: 3.500 1st Qu.:1.0 1st Qu.:0.00 both :8 HF:5 Median : 4.200 Median :2.0 Median :2.00 grazing :5 NM:6 Mean : 4.850 Mean :2.9 Mean :1.75 SF:6 3rd Qu.: 5.725 3rd Qu.:5.0 3rd Qu.:3.00 Max. :11.500 Max. :5.0 Max. :4.00 > is.ordered(dunedata$envir$use) [1] TRUE > score(dudi.mix(dunedata$envir, scan = FALSE)) > > > > cleanEx(); ..nameEx <- "ecg" > > ### * ecg > > flush(stderr()); flush(stdout()) > > ### Name: ecg > ### Title: Electrocardiogram data > ### Aliases: ecg > ### Keywords: datasets > > ### ** Examples > > ## Not run: > ##D # figure 130 in Percival and Walden (2000) > ##D if (require(waveslim) == TRUE) { > ##D data(ecg) > ##D ecg.level <- haar2level(ecg) > ##D ecg.haar <- orthobasis.haar(length(ecg)) > ##D ecg.mld <- mld(ecg, ecg.haar, ecg.level, plot = FALSE) > ##D res <- cbind.data.frame(apply(ecg.mld[,1:5],1,sum), ecg.mld[,6:11]) > ##D par(mfrow = c(8,1)) > ##D par(mar = c(2, 5, 1.5, 0.6)) > ##D plot(as.ts(ecg), ylab = "ECG") > ##D apply(res, 2, function(x) plot(as.ts(x), ylim = range(res), > ##D ylab = "")) > ##D par(mfrow = c(1,1)) > ##D } > ## End(Not run) > > > > cleanEx(); ..nameEx <- "ecomor" > > ### * ecomor > > flush(stderr()); flush(stdout()) > > ### Name: ecomor > ### Title: Ecomorphological Convergence > ### Aliases: ecomor > ### Keywords: datasets > > ### ** Examples > > data(ecomor) > ric <- apply(ecomor$habitat, 2, sum) > s.corcircle(dudi.pca(log(ecomor$morpho), scan = FALSE)$co) > > forsub <- data.frame(t(apply(ecomor$forsub, 1, + function (x) x/sum(x)))) > pca1 <- dudi.pca(forsub, scan = FALSE, scale = FALSE) > s.arrow(pca1$c1) > w <- as.matrix(forsub) > s.label(w, clab = 0, add.p = TRUE, cpoi = 2) > > diet <- data.frame(t(apply(ecomor$diet, 1, + function (x) x/sum(x)))) > pca2 <- dudi.pca(diet, scan = FALSE, scale = FALSE) > s.arrow(pca2$c1) > w <- as.matrix(diet) > s.label(w, clab = 0, add.p = TRUE, cpoi = 2) > ## Not run: > ##D dmorpho <- dist.quant(log(ecomor$morpho), 3) > ##D dhabitat <- dist.binary(ecomor$habitat, 1) > ##D > ##D mantel.randtest(dmorpho, dhabitat) > ##D RV.rtest(pcoscaled(dmorpho), pcoscaled(dhabitat), 999) > ##D procuste.randtest(pcoscaled(dmorpho), pcoscaled(dhabitat)) > ##D > ##D ecophy <- taxo2phylog(ecomor$taxo) > ##D table.phylog(ecomor$habitat, ecophy, clabel.n = 0.5, f = 0.6, > ##D clabel.c = 0.75, clabel.r = 0.5, csi = 0.75, cleg = 0) > ##D plot.phylog(ecophy, clabel.n = 0.75, clabel.l = 0.75, > ##D labels.l = ecomor$labels[,"latin"]) > ##D dtaxo <- ecophy$Wdist > ##D mantel.randtest(dmorpho, dtaxo) > ##D mantel.randtest(dhabitat, dtaxo) > ## End(Not run) > > > cleanEx(); ..nameEx <- "elec88" > > ### * elec88 > > flush(stderr()); flush(stdout()) > > ### Name: elec88 > ### Title: Electoral Data > ### Aliases: elec88 > ### Keywords: datasets > > ### ** Examples > > data(elec88) > apply(elec88$tab, 2, mean) Mitterand Chirac Barre Le.Pen Lajoinie Waechter Juquin 34.3063830 20.2670213 16.4680851 13.7606383 6.7106383 3.8638298 2.1670213 Laguillier Boussel 2.0574468 0.3989362 > summary(elec88$res) Min. 1st Qu. Median Mean 3rd Qu. Max. 0.40 2.10 6.80 11.11 16.50 34.10 > > par(mfrow = c(2,2)) > plot(elec88$area[,2:3], type = "n", asp = 1) > lpoly <- split(elec88$area[,2:3], elec88$area[,1]) > lapply(lpoly, function(x) {points (x,type = "l");invisible()}) $D1 NULL $D10 NULL $D11 NULL $D12 NULL $D13 NULL $D14 NULL $D15 NULL $D16 NULL $D17 NULL $D18 NULL $D19 NULL $D2 NULL $D21 NULL $D22 NULL $D23 NULL $D24 NULL $D25 NULL $D26 NULL $D27 NULL $D28 NULL $D29 NULL $D3 NULL $D30 NULL $D31 NULL $D32 NULL $D33 NULL $D34 NULL $D35 NULL $D36 NULL $D37 NULL $D38 NULL $D39 NULL $D4 NULL $D40 NULL $D41 NULL $D42 NULL $D43 NULL $D44 NULL $D45 NULL $D46 NULL $D47 NULL $D48 NULL $D49 NULL $D5 NULL $D50 NULL $D51 NULL $D52 NULL $D53 NULL $D54 NULL $D55 NULL $D56 NULL $D57 NULL $D58 NULL $D59 NULL $D6 NULL $D60 NULL $D61 NULL $D62 NULL $D63 NULL $D64 NULL $D65 NULL $D66 NULL $D67 NULL $D68 NULL $D69 NULL $D7 NULL $D70 NULL $D71 NULL $D72 NULL $D73 NULL $D74 NULL $D75 NULL $D76 NULL $D77 NULL $D78 NULL $D79 NULL $D8 NULL $D80 NULL $D81 NULL $D82 NULL $D83 NULL $D84 NULL $D85 NULL $D86 NULL $D87 NULL $D88 NULL $D89 NULL $D9 NULL $D90 NULL $D91 NULL $D92 NULL $D93 NULL $D94 NULL $D95 NULL > polygon(elec88$area[elec88$area$V1=="D25", 2:3], col = 1) > area.plot(elec88$area, graph = elec88$neig, lwdg = 1) > polygon(elec88$area[elec88$area$V1=="D25", 2:3], col = 1) > pca1 <- dudi.pca(elec88$tab, scal = FALSE, scan = FALSE) > area.plot(elec88$area, val = elec88$xy[,1] + elec88$xy[,2]) > area.plot(elec88$area, val = pca1$li[,1], sub = "F1 PCA", + csub = 2, cleg = 1.5) > par(mfrow = c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "escopage" > > ### * escopage > > flush(stderr()); flush(stdout()) > > ### Name: escopage > ### Title: K-tables of wine-tasting > ### Aliases: escopage > ### Keywords: datasets > > ### ** Examples > > data(escopage) > w <- data.frame(scale(escopage$tab)) > w <- ktab.data.frame(w, escopage$blo) > names(w)[1:4] <- escopage$tab.names > plot(mfa(w, scan = FALSE)) > > > > cleanEx(); ..nameEx <- "euro123" > > ### * euro123 > > flush(stderr()); flush(stdout()) > > ### Name: euro123 > ### Title: Triangular Data > ### Aliases: euro123 > ### Keywords: datasets > > ### ** Examples > > data(euro123) > par(mfrow = c(2,2)) > triangle.plot(euro123$in78, addaxes = TRUE) > triangle.plot(euro123$in86, addaxes = TRUE) > triangle.plot(euro123$in97, addaxes = TRUE) > triangle.biplot(euro123$in78, euro123$in97) > par(mfrow = c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "fission" > > ### * fission > > flush(stderr()); flush(stdout()) > > ### Name: fission > ### Title: Fission pattern and heritable morphological traits > ### Aliases: fission > ### Keywords: datasets > > ### ** Examples > > data(fission) > fis.phy <- newick2phylog(fission$tre) > table.phylog(fission$tab[names(fis.phy$leaves),], fis.phy, csi = 2) > gearymoran(fis.phy$Amat, fission$tab) class: krandtest test number: 5 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 GM1 -0.228 0.047 0.955 2 GM2 -0.127 0.233 0.771 3 GM3 -0.054 0.554 0.448 4 GN1 -0.045 0.502 0.501 5 GN2 -0.203 0.089 0.913 > > > > cleanEx(); ..nameEx <- "foucart" > > ### * foucart > > flush(stderr()); flush(stdout()) > > ### Name: foucart > ### Title: K-tables Correspondence Analysis with the same rows and the same > ### columns > ### Aliases: foucart plot.foucart print.foucart > ### Keywords: multivariate > > ### ** Examples > > data(bf88) > fou1 <- foucart(bf88, scann = FALSE, nf = 3) > fou1 Foucart's COA class: foucart coa dudi $call: foucart(X = bf88, scannf = FALSE, nf = 3) table number: 6 $nf: 3 axis-components saved $rank: 3 eigen values: 0.5278 0.3591 0.3235 blo vector 6 blocks vector length mode content $cw 4 numeric column weights $lw 79 numeric row weights $eig 3 numeric eigen values data.frame nrow ncol content $tab 79 4 modified array $li 79 3 row coordinates $l1 79 3 row normed scores $co 4 3 column coordinates $c1 4 3 column normed scores **** Intrastructure **** data.frame nrow ncol content $Tli 474 3 row coordinates (each table) $Tco 24 3 col coordinates (each table) $TL 474 2 factors for Tli $TC 24 2 factors for Tco > plot(fou1) > > data(meaudret) > l1 <- split(meaudret$fau, meaudret$plan$dat) > l1 <- lapply(l1, function(x) + {row.names(x) <- paste("Sta",1:5,sep="");x}) > fou2 <- foucart(l1, scan = FALSE) > kplot(fou2, clab.r = 2) > > > > cleanEx(); ..nameEx <- "friday87" > > ### * friday87 > > flush(stderr()); flush(stdout()) > > ### Name: friday87 > ### Title: Faunistic K-tables > ### Aliases: friday87 > ### Keywords: datasets > > ### ** Examples > > data(friday87) > wfri <- data.frame(scale(friday87$fau, scal = FALSE)) > wfri <- ktab.data.frame(wfri, friday87$fau.blo, + tabnames = friday87$tab.names) > kplot(sepan(wfri), clab.r = 2, clab.c = 1) > > > > cleanEx(); ..nameEx <- "fruits" > > ### * fruits > > flush(stderr()); flush(stdout()) > > ### Name: fruits > ### Title: Pair of Tables > ### Aliases: fruits > ### Keywords: datasets > > ### ** Examples > > data(fruits) > par(mfrow = c(2,2)) > pcajug <- dudi.pca(fruits$jug, scann = FALSE) > s.corcircle(pcajug$co) > s.class(pcajug$li, fac = fruits$type) > > pcavar <- dudi.pca(fruits$var, scann = FALSE) > s.corcircle(pcavar$co) > s.class(pcavar$li, fac = fruits$type) > > par(mfrow = c(1,1)) > plot(coinertia(pcajug, pcavar, scan = FALSE)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "fuzzygenet" > > ### * fuzzygenet > > flush(stderr()); flush(stdout()) > > ### Name: fuzzygenet > ### Title: Reading a table of genetic data (diploid individuals) > ### Aliases: fuzzygenet > ### Keywords: multivariate > > ### ** Examples > > data(casitas) > casitas[1:5, ] Aat Amy Es1 Es2 Es10 Hbb Gpd1 Idh1 Mod1 Mod2 Mpi 1 100100 080080 094094 100100 100100 120120 100100 100100 110110 100100 100100 2 100100 080100 094094 100100 100100 120120 100100 100125 110110 100100 100100 3 100100 080080 094094 100100 100100 120120 100100 100100 110110 100100 100100 4 100100 080080 094094 100100 100100 120120 100100 100125 100100 100100 100100 5 100100 080080 094094 100100 100100 120120 100100 100100 110110 100100 100100 Np Pgm1 Pgm2 Sod 1 100100 100100 100100 100100 2 100100 100100 100100 100100 3 100100 100100 100100 100100 4 100100 100100 100100 100100 5 100100 100100 100100 100100 > casitas <- fuzzygenet(casitas) > attributes(casitas) $names [1] "L01.1" "L01.2" "L02.1" "L02.2" "L03.1" "L03.2" "L04.1" "L04.2" "L04.3" [10] "L05.1" "L05.2" "L06.1" "L06.2" "L07.1" "L07.2" "L07.3" "L08.1" "L08.2" [19] "L08.3" "L08.4" "L09.1" "L09.2" "L09.3" "L10.1" "L10.2" "L11.1" "L11.2" [28] "L12.1" "L12.2" "L12.3" "L12.4" "L13.1" "L13.2" "L13.3" "L14.1" "L14.2" [37] "L15.1" "L15.2" $row.names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" "49" "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" "60" [61] "61" "62" "63" "64" "65" "66" "67" "68" "69" "70" "71" "72" "73" "74" $class [1] "data.frame" $col.blocks L01 L02 L03 L04 L05 L06 L07 L08 L09 L10 L11 L12 L13 L14 L15 2 2 2 3 2 2 3 4 3 2 2 4 3 2 2 $all.names L01.1 L01.2 L02.1 L02.2 L03.1 L03.2 L04.1 "Aat.080" "Aat.100" "Amy.080" "Amy.100" "Es1.094" "Es1.100" "Es2.095" L04.2 L04.3 L05.1 L05.2 L06.1 L06.2 L07.1 "Es2.098" "Es2.100" "Es10.060" "Es10.100" "Hbb.110" "Hbb.120" "Gpd1.095" L07.2 L07.3 L08.1 L08.2 L08.3 L08.4 L09.1 "Gpd1.100" "Gpd1.105" "Idh1.050" "Idh1.080" "Idh1.100" "Idh1.125" "Mod1.100" L09.2 L09.3 L10.1 L10.2 L11.1 L11.2 L12.1 "Mod1.110" "Mod1.120" "Mod2.100" "Mod2.120" "Mpi.100" "Mpi.120" "Np.080" L12.2 L12.3 L12.4 L13.1 L13.2 L13.3 L14.1 "Np.085" "Np.090" "Np.100" "Pgm1.060" "Pgm1.080" "Pgm1.100" "Pgm2.080" L14.2 L15.1 L15.2 "Pgm2.100" "Sod.080" "Sod.100" $loc.names L01 L02 L03 L04 L05 L06 L07 L08 L09 L10 L11 "Aat" "Amy" "Es1" "Es2" "Es10" "Hbb" "Gpd1" "Idh1" "Mod1" "Mod2" "Mpi" L12 L13 L14 L15 "Np" "Pgm1" "Pgm2" "Sod" $row.w [1] 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 [7] 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 [13] 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 [19] 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 [25] 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 [31] 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 [37] 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 [43] 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 [49] 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 [55] 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 [61] 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 [67] 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 0.01351351 [73] 0.01351351 0.01351351 $col.freq L01.1 L01.2 L02.1 L02.2 L03.1 L03.2 0.148648649 0.851351351 0.750000000 0.250000000 0.702702703 0.297297297 L04.1 L04.2 L04.3 L05.1 L05.2 L06.1 0.081081081 0.195945946 0.722972973 0.116438356 0.883561644 0.465753425 L06.2 L07.1 L07.2 L07.3 L08.1 L08.2 0.534246575 0.375000000 0.534722222 0.090277778 0.101351351 0.006756757 L08.3 L08.4 L09.1 L09.2 L09.3 L10.1 0.608108108 0.283783784 0.128378378 0.797297297 0.074324324 0.689189189 L10.2 L11.1 L11.2 L12.1 L12.2 L12.3 0.310810811 0.794520548 0.205479452 0.061643836 0.089041096 0.061643836 L12.4 L13.1 L13.2 L13.3 L14.1 L14.2 0.787671233 0.027397260 0.130136986 0.842465753 0.082191781 0.917808219 L15.1 L15.2 0.121621622 0.878378378 $col.num [1] Aat Aat Amy Amy Es1 Es1 Es2 Es2 Es2 Es10 Es10 Hbb Hbb Gpd1 Gpd1 [16] Gpd1 Idh1 Idh1 Idh1 Idh1 Mod1 Mod1 Mod1 Mod2 Mod2 Mpi Mpi Np Np Np [31] Np Pgm1 Pgm1 Pgm1 Pgm2 Pgm2 Sod Sod 15 Levels: Aat Amy Es1 Es10 Es2 Gpd1 Hbb Idh1 Mod1 Mod2 Mpi Np Pgm1 ... Sod > rm(casitas) > > > > cleanEx(); ..nameEx <- "gearymoran" > > ### * gearymoran > > flush(stderr()); flush(stdout()) > > ### Name: gearymoran > ### Title: Moran's I and Geary'c randomization tests for spatial and > ### phylogenetic autocorrelation > ### Aliases: gearymoran > ### Keywords: spatial ts > > ### ** Examples > > # a spatial example > data(mafragh) > tab0 <- (as.data.frame(scalewt(mafragh$mil))) > bilis0 <- neig2mat(mafragh$neig) > gm0 <- gearymoran(bilis0, tab0, 999) > gm0 class: krandtest test number: 11 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 Argile 0.424 1 0.001 2 Limon 0.338 1 0.001 3 Sable 0.099 0.945 0.057 4 K2O 0.273 1 0.001 5 Mg++ 0.186 0.998 0.004 6 Na+/100g 0.267 1 0.001 7 K+ 0.661 1 0.001 8 Conduc 0.3 1 0.001 9 Capa_Reten 0.201 1 0.002 10 Na+/l 0.243 1 0.001 11 Altitude 0.595 1 0.001 > plot(gm0, nclass = 20) > > ## Not run: > ##D # a phylogenetic example > ##D data(mjrochet) > ##D mjr.phy <- newick2phylog(mjrochet$tre) > ##D mjr.tab <- log(mjrochet$tab) > ##D gearymoran(mjr.phy$Amat, mjr.tab) > ##D gearymoran(mjr.phy$Wmat, mjr.tab) > ##D par(mfrow = c(1,2)) > ##D table.value(mjr.phy$Wmat, csi = 0.25, clabel.r = 0) > ##D table.value(mjr.phy$Amat, csi = 0.35, clabel.r = 0) > ##D par(mfrow = c(1,1)) > ## End(Not run) > > > cleanEx(); ..nameEx <- "genet" > > ### * genet > > flush(stderr()); flush(stdout()) > > ### Name: genet > ### Title: A class of data: tables of populations and alleles > ### Aliases: genet char2genet count2genet freq2genet > ### Keywords: multivariate > > ### ** Examples > > data(casitas) > casitas[24,] Aat Amy Es1 Es2 Es10 Hbb Gpd1 Idh1 Mod1 Mod2 Mpi 24 100100 080100 094094 100100 000000 000000 000000 125125 110110 100100 100100 Np Pgm1 Pgm2 Sod 24 000000 100100 100100 100100 > casitas.pop <- as.factor(rep(c("dome", "cast", "musc", "casi"), c(24,11,9,30))) > casi.genet <- char2genet(casitas, casitas.pop, complete=TRUE) > names(casi.genet$tab) [1] "L01.1" "L01.2" "L02.1" "L02.2" "L03.1" "L03.2" "L04.1" "L04.2" "L05.1" [10] "L05.2" "L05.3" "L06.1" "L06.2" "L06.3" "L07.1" "L07.2" "L08.1" "L08.2" [19] "L08.3" "L08.4" "L09.1" "L09.2" "L09.3" "L10.1" "L10.2" "L11.1" "L11.2" [28] "L12.1" "L12.2" "L12.3" "L12.4" "L13.1" "L13.2" "L13.3" "L14.1" "L14.2" [37] "L15.1" "L15.2" > casi.genet$tab[,1:8] L01.1 L01.2 L02.1 L02.2 L03.1 L03.2 L04.1 P1 0.2500000 0.7500000 0.8333333 0.1666667 0.8500000 0.1500000 0.0000000 P2 0.3181818 0.6818182 1.0000000 0.0000000 0.2272727 0.7727273 0.0000000 P3 0.0000000 1.0000000 0.8125000 0.1875000 1.0000000 0.0000000 0.0000000 P4 0.0000000 1.0000000 0.0000000 1.0000000 0.0000000 1.0000000 0.9444444 L04.2 P1 1.00000000 P2 1.00000000 P3 1.00000000 P4 0.05555556 > casi.genet$pop.names P1 P2 P3 P4 "casi" "cast" "dome" "musc" > casi.genet$loc.names L01 L02 L03 L04 L05 L06 L07 L08 L09 L10 L11 "Aat" "Amy" "Es1" "Es10" "Es2" "Gpd1" "Hbb" "Idh1" "Mod1" "Mod2" "Mpi" L12 L13 L14 L15 "Np" "Pgm1" "Pgm2" "Sod" > casi.genet$all.names L01.1 L01.2 L02.1 L02.2 L03.1 L03.2 L04.1 "Aat.080" "Aat.100" "Amy.080" "Amy.100" "Es1.094" "Es1.100" "Es10.060" L04.2 L05.1 L05.2 L05.3 L06.1 L06.2 L06.3 "Es10.100" "Es2.095" "Es2.098" "Es2.100" "Gpd1.095" "Gpd1.100" "Gpd1.105" L07.1 L07.2 L08.1 L08.2 L08.3 L08.4 L09.1 "Hbb.110" "Hbb.120" "Idh1.050" "Idh1.080" "Idh1.100" "Idh1.125" "Mod1.100" L09.2 L09.3 L10.1 L10.2 L11.1 L11.2 L12.1 "Mod1.110" "Mod1.120" "Mod2.100" "Mod2.120" "Mpi.100" "Mpi.120" "Np.080" L12.2 L12.3 L12.4 L13.1 L13.2 L13.3 L14.1 "Np.085" "Np.090" "Np.100" "Pgm1.060" "Pgm1.080" "Pgm1.100" "Pgm2.080" L14.2 L15.1 L15.2 "Pgm2.100" "Sod.080" "Sod.100" > casi.genet$loc.blocks # number of allelic forms by loci L01 L02 L03 L04 L05 L06 L07 L08 L09 L10 L11 L12 L13 L14 L15 2 2 2 2 3 3 2 4 3 2 2 4 3 2 2 > casi.genet$loc.fac # factor classifying the allelic forms by locus [1] L01 L01 L02 L02 L03 L03 L04 L04 L05 L05 L05 L06 L06 L06 L07 L07 L08 L08 L08 [20] L08 L09 L09 L09 L10 L10 L11 L11 L12 L12 L12 L12 L13 L13 L13 L14 L14 L15 L15 Levels: L01 L02 L03 L04 L05 L06 L07 L08 L09 L10 L11 L12 L13 L14 L15 > casi.genet$pop.loc # table populations loci L01 L02 L03 L04 L05 L06 L07 L08 L09 L10 L11 L12 L13 L14 L15 P1 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 P2 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 P3 24 24 24 23 24 23 23 24 24 24 24 23 24 24 24 P4 9 9 9 9 9 8 9 9 9 9 8 9 8 8 9 > names(casi.genet$comp) [1] "L01.1" "L01.2" "L02.1" "L02.2" "L03.1" "L03.2" "L04.1" "L04.2" "L05.1" [10] "L05.2" "L05.3" "L06.1" "L06.2" "L06.3" "L07.1" "L07.2" "L08.1" "L08.2" [19] "L08.3" "L08.4" "L09.1" "L09.2" "L09.3" "L10.1" "L10.2" "L11.1" "L11.2" [28] "L12.1" "L12.2" "L12.3" "L12.4" "L13.1" "L13.2" "L13.3" "L14.1" "L14.2" [37] "L15.1" "L15.2" > casi.genet$comp[1:4,] L01.1 L01.2 L02.1 L02.2 L03.1 L03.2 L04.1 L04.2 L05.1 L05.2 L05.3 L06.1 01 0 2 2 0 1 1 0 2 2 0 0 0 02 1 1 2 0 2 0 0 2 0 0 2 0 03 1 1 1 1 2 0 0 2 2 0 0 0 04 0 2 1 1 2 0 0 2 0 0 2 2 L06.2 L06.3 L07.1 L07.2 L08.1 L08.2 L08.3 L08.4 L09.1 L09.2 L09.3 L10.1 01 0 2 1 1 0 0 1 1 0 2 0 0 02 0 2 1 1 0 0 2 0 0 2 0 1 03 2 0 1 1 0 0 2 0 0 2 0 0 04 0 0 2 0 0 0 2 0 0 2 0 0 L10.2 L11.1 L11.2 L12.1 L12.2 L12.3 L12.4 L13.1 L13.2 L13.3 L14.1 L14.2 01 2 2 0 0 0 0 2 0 0 2 0 2 02 1 2 0 0 0 0 2 0 0 2 0 2 03 2 2 0 0 0 0 2 0 0 2 0 2 04 2 2 0 0 0 0 2 0 0 2 0 2 L15.1 L15.2 01 0 2 02 0 2 03 0 2 04 0 2 > casi.genet$comp.pop [1] P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 [26] P1 P1 P1 P1 P1 P2 P2 P2 P2 P2 P2 P2 P2 P2 P2 P2 P3 P3 P3 P3 P3 P3 P3 P3 P3 [51] P3 P3 P3 P3 P3 P3 P3 P3 P3 P3 P3 P3 P3 P3 P4 P4 P4 P4 P4 P4 P4 P4 Levels: P1 P2 P3 P4 > casi.genet$center L01.1 L01.2 L02.1 L02.2 L03.1 L03.2 0.148648649 0.851351351 0.750000000 0.250000000 0.702702703 0.297297297 L04.1 L04.2 L05.1 L05.2 L05.3 L06.1 0.116438356 0.883561644 0.081081081 0.195945946 0.722972973 0.375000000 L06.2 L06.3 L07.1 L07.2 L08.1 L08.2 0.534722222 0.090277778 0.465753425 0.534246575 0.101351351 0.006756757 L08.3 L08.4 L09.1 L09.2 L09.3 L10.1 0.608108108 0.283783784 0.128378378 0.797297297 0.074324324 0.689189189 L10.2 L11.1 L11.2 L12.1 L12.2 L12.3 0.310810811 0.794520548 0.205479452 0.061643836 0.089041096 0.061643836 L12.4 L13.1 L13.2 L13.3 L14.1 L14.2 0.787671233 0.027397260 0.130136986 0.842465753 0.082191781 0.917808219 L15.1 L15.2 0.121621622 0.878378378 > apply(casi.genet$tab,2,mean) L01.1 L01.2 L02.1 L02.2 L03.1 L03.2 L04.1 0.14204545 0.85795455 0.66145833 0.33854167 0.51931818 0.48068182 0.23611111 L04.2 L05.1 L05.2 L05.3 L06.1 L06.2 L06.3 0.76388889 0.05719697 0.37247475 0.57032828 0.56666667 0.37916667 0.05416667 L07.1 L07.2 L08.1 L08.2 L08.3 L08.4 L09.1 0.54431818 0.45568182 0.13446970 0.01136364 0.47935606 0.37481061 0.09365530 L09.2 L09.3 L10.1 L10.2 L11.1 L11.2 L12.1 0.75356692 0.15277778 0.80833333 0.19166667 0.59943182 0.40056818 0.12500000 L12.2 L12.3 L12.4 L13.1 L13.2 L13.3 L14.1 0.14772727 0.12500000 0.60227273 0.06250000 0.26704545 0.67045455 0.10729167 L14.2 L15.1 L15.2 0.89270833 0.25000000 0.75000000 > casi.genet$pop.loc[,"L15"] [1] 30 11 24 9 > casi.genet$tab[, c("L15.1","L15.2")] L15.1 L15.2 P1 0 1 P2 0 1 P3 0 1 P4 1 0 > class(casi.genet) [1] "genet" "list" > casitas.coa <- dudi.coa(casi.genet$comp, scannf = FALSE) > s.class(casitas.coa$li,casi.genet$comp.pop) > > > > cleanEx(); ..nameEx <- "granulo" > > ### * granulo > > flush(stderr()); flush(stdout()) > > ### Name: granulo > ### Title: Granulometric Curves > ### Aliases: granulo > ### Keywords: datasets > > ### ** Examples > > data(granulo) > w <- t(apply(granulo$tab, 1, function (x) x / sum(x))) > w <- data.frame(w) > wtr <- data.frame(t(w)) > wmoy <- data.frame(matrix(apply(wtr, 1, mean), 1)) > d1 <- dudi.pca(w, scal = FALSE, scan = FALSE) > wmoy <- suprow.default(d1, wmoy)$lisup > s.arrow(d1$c1, clab = 1.5) > s.distri(d1$c1, wtr, cstar = 0.33, cell = 0, + axesell = FALSE, add.p = TRUE, clab = 0.75) > s.label(wmoy, cpoi = 5, clab = 0, add.p = TRUE) > > > > cleanEx(); ..nameEx <- "gridrowcol" > > ### * gridrowcol > > flush(stderr()); flush(stdout()) > > ### Name: gridrowcol > ### Title: Complete regular grid analysis > ### Aliases: gridrowcol > ### Keywords: spatial > > ### ** Examples > > w <- gridrowcol(8,5) > par(mfrow = c(1,2)) > area.plot(w$area,center = w$xy, graph = w$neig, clab = 0.75) > area.plot(w$area,center = w$xy, graph = w$neig, clab = 0.75, + label = as.character(1:40)) > par(mfrow = c(1,1)) > > par(mfrow = c(5,8)) > for(k in 1:39) + s.value(w$xy, w$orthobasis[,k], csi = 3, cleg = 0, csub = 2, + sub = as.character(signif(attr(w$orthobasis, "values")[k],3)), + incl = FALSE, addax = FALSE, cgr = 0, ylim = c(0,10)) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "housetasks" > > ### * housetasks > > flush(stderr()); flush(stdout()) > > ### Name: housetasks > ### Title: Contingency Table > ### Aliases: housetasks > ### Keywords: datasets > > ### ** Examples > > data(housetasks) > nsc1 <- dudi.nsc(housetasks, scan = FALSE) > s.label(nsc1$c1, clab = 1.25) > s.arrow(nsc1$li, add.pl = TRUE, clab = 0.75) > > > > cleanEx(); ..nameEx <- "humDNAm" > > ### * humDNAm > > flush(stderr()); flush(stdout()) > > ### Name: humDNAm > ### Title: human mitochondrial DNA restriction data > ### Aliases: humDNAm > ### Keywords: datasets > > ### ** Examples > > data(humDNAm) > dpcoahum <- dpcoa(humDNAm$samples, sqrt(humDNAm$distances), scan = FALSE, nf = 2) > plot(dpcoahum, csize = 1.5) > > > > cleanEx(); ..nameEx <- "ichtyo" > > ### * ichtyo > > flush(stderr()); flush(stdout()) > > ### Name: ichtyo > ### Title: Point sampling of fish community > ### Aliases: ichtyo > ### Keywords: datasets > > ### ** Examples > > data(ichtyo) > dudi1 <- dudi.dec(ichtyo$tab, ichtyo$eff, scan = FALSE) > s.class(dudi1$li, ichtyo$dat, wt = ichtyo$eff / sum(ichtyo$eff)) > > > > cleanEx(); ..nameEx <- "inertia.dudi" > > ### * inertia.dudi > > flush(stderr()); flush(stdout()) > > ### Name: inertia.dudi > ### Title: Statistics of inertia in a one-table analysis > ### Aliases: inertia.dudi > ### Keywords: multivariate > > ### ** Examples > > data(housetasks) > coa1 <- dudi.coa(housetasks, scann = FALSE) > inertia.dudi(coa1, col = TRUE, row = FALSE)$col.rel Comp1 Comp2 con.tra Wife -8019 -1524 2700 Alternating -48 -1051 1057 Husband 7720 -2075 3421 Jointly 207 9773 2823 > > > > cleanEx(); ..nameEx <- "irishdata" > > ### * irishdata > > flush(stderr()); flush(stdout()) > > ### Name: irishdata > ### Title: Geary's Irish Data > ### Aliases: irishdata > ### Keywords: datasets > > ### ** Examples > > data(irishdata) > par(mfrow = c(2,2)) > area.plot(irishdata$area, lab = irishdata$county.names, clab = 0.75) > area.plot(irishdata$area) > apply(irishdata$contour, 1, function(x) segments(x[1],x[2],x[3],x[4], + lwd = 3)) NULL > s.corcircle(dudi.pca(irishdata$tab, scan = FALSE)$co) > score <- dudi.pca(irishdata$tab, scan = FALSE, nf = 1)$li$Axis1 > names(score) <- row.names(irishdata$tab) > area.plot(irishdata$area, score) > par(mfrow = c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "is.euclid" > > ### * is.euclid > > flush(stderr()); flush(stdout()) > > ### Name: is.euclid > ### Title: Is a Distance Matrix Euclidean ? > ### Aliases: is.euclid summary.dist mat2dist dist2mat > ### Keywords: array > > ### ** Examples > > w <- matrix(runif(10000), 100, 100) > w <- dist(w) > summary(w) Class: dist Distance matrix by lower triangle : d21, d22, ..., d2n, d32, ... Size: 100 Labels: call: dist(x = w) method: euclidean Euclidean matrix (Gower 1966): TRUE > is.euclid (w) # TRUE [1] TRUE > w <- quasieuclid(w) # no correction need in: quasieuclid(w) Warning in quasieuclid(w) : Euclidean distance found : no correction need > w <- lingoes(w) # no correction need in: lingoes(w) Warning in lingoes(w) : Euclidean distance found : no correction need > w <- cailliez(w) # no correction need in: cailliez(w) Warning in cailliez(w) : Euclidean distance found : no correction need > rm(w) > > > > cleanEx(); ..nameEx <- "julliot" > > ### * julliot > > flush(stderr()); flush(stdout()) > > ### Name: julliot > ### Title: Seed dispersal > ### Aliases: julliot > ### Keywords: datasets > > ### ** Examples > > data(julliot) > par(mfrow = c(3,3)) > ## Not run: > ##D for(k in 1:7) > ##D area.plot(julliot$area,val = log(julliot$tab[,k]+1), > ##D sub = names(julliot$tab)[k], csub = 2.5) > ## End(Not run) > > if (require(splancs, quiet = TRUE)){ + par(mfrow = c(3,3)) + for(k in 1:7) + s.image(julliot$xy, log(julliot$tab[,k]+1), kgrid = 3, span = 0.25, + sub = names(julliot$tab)[k], csub = 2.5) + } Spatial Point Pattern Analysis Code in S-Plus Version 2 - Spatial and Space-Time analysis > > ## Not run: > ##D par(mfrow = c(3,3)) > ##D for(k in 1:7) { > ##D area.plot(julliot$area) > ##D s.value(julliot$xy, scalewt(log(julliot$tab[,k]+1)), > ##D sub = names(julliot$tab)[k],csub = 2.5, add.p = TRUE) > ##D } > ## End(Not run) > par(mfrow = c(3,3)) > for(k in 1:7) + s.value(julliot$xy,log(julliot$tab[,k]+1), + sub = names(julliot$tab)[k], csub = 2.5) > > ## Not run: > ##D if (require(spdep, quiet = TRUE)){ > ##D par(mfrow = c(1,1)) > ##D neig0 <- nb2neig(dnearneigh(as.matrix(julliot$xy), 1, 1.8)) > ##D s.label(julliot$xy, neig = neig0, clab = 0.75, incl = FALSE, > ##D addax = FALSE, grid = FALSE) > ##D > ##D gearymoran(neig.util.LtoG(neig0), log(julliot$tab+1)) > ##D orthogram(log(julliot$tab[,3]+1), ortho = scores.neig(neig0), > ##D nrepet = 9999)} > ## End(Not run) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "jv73" > > ### * jv73 > > flush(stderr()); flush(stdout()) > > ### Name: jv73 > ### Title: K-tables Multi-Regions > ### Aliases: jv73 > ### Keywords: datasets > > ### ** Examples > > data(jv73) > s.label(jv73$xy, contour = jv73$contour, incl = FALSE, + clab = 0.75) > s.class(jv73$xy, jv73$fac.riv, add.p = TRUE, cell = 0, + axese = FALSE, csta = 0, cpoi = 0, clab = 1.25) > > w <- split(jv73$morpho, jv73$fac.riv) > w <- lapply(w, function(x) t(dudi.pca(x, scann = FALSE))) > w <- ktab.list.dudi(w) > kplot(sepan(w), perm = TRUE, clab.r = 0, clab.c = 2, show = FALSE) > > > > cleanEx(); ..nameEx <- "kcponds" > > ### * kcponds > > flush(stderr()); flush(stdout()) > > ### Name: kcponds > ### Title: Ponds in a nature reserve > ### Aliases: kcponds > ### Keywords: datasets > > ### ** Examples > > data(kcponds) > > par(mfrow=c(3,1)) > area.plot(kcponds$area) > s.label(kcponds$xy,add.p = TRUE, cpoi = 2, clab = 0) > s.label(kcponds$xy,add.p = TRUE, cpoi = 3, clab = 0) > s.label(kcponds$xy,add.p = TRUE, cpoi = 0, clab = 0, + neig = kcponds$neig, cneig = 1) > area.plot(kcponds$area) > s.label(kcponds$xy, add.p = TRUE, clab = 1.5) > w <- as.numeric(scalewt(kcponds$tab$N)) > s.value(kcponds$xy, w, cleg = 2, sub = "Nitrogen concentration", + csub = 4, possub = "topright", include = FALSE) > par(mfrow = c(1,1)) > ## Not run: > ##D par(mfrow=c(3,1)) > ##D pca1 <- dudi.pca(kcponds$tab, scan = FALSE, nf = 4) > ##D if (require(maptools, quiet = TRUE) & require(spdep, quiet = TRUE)) { > ##D multi1 <- multispati(pca1, nb2listw(neig2nb(kcponds$neig)), > ##D scan = FALSE, nfposi = 2, nfnega = 1) > ##D summary(multi1)} > ##D par(mfrow = c(1,1)) > ## End(Not run) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "kdist" > > ### * kdist > > flush(stderr()); flush(stdout()) > > ### Name: kdist > ### Title: the class of objects 'kdist' (K distance matrices) > ### Aliases: kdist c.kdist print.kdist [.kdist as.data.frame.kdist > ### Keywords: multivariate > > ### ** Examples > > # starting from a list of matrices > data(yanomama) > lapply(yanomama,class) $geo [1] "matrix" $gen [1] "matrix" $ant [1] "matrix" > kd1 = kdist(yanomama) > print(kd1) List of distances matrices call: kdist(yanomama) class: kdist number of distances: 3 size: 19 labels: [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" geo: non euclidean distance gen: non euclidean distance ant: non euclidean distance > > # giving the correlations of Mantel's test > cor(as.data.frame(kd1)) geo gen ant geo 1.0000000 0.5098684 0.8428053 gen 0.5098684 1.0000000 0.2995506 ant 0.8428053 0.2995506 1.0000000 > pairs(as.data.frame(kd1)) > > # starting from a list of objects 'dist' > data(friday87) > fri.w <- ktab.data.frame(friday87$fau, friday87$fau.blo, + tabnames = friday87$tab.names) > fri.kd = lapply(1:10, function(x) dist.binary(fri.w[[x]],2)) > names(fri.kd) = friday87$tab.names > unlist(lapply(fri.kd,class)) # a list of distances Hemiptera Odonata Trichoptera Ephemeroptera Coleoptera "dist" "dist" "dist" "dist" "dist" Diptera Hydracarina Malacostraca Mollusca Oligochaeta "dist" "dist" "dist" "dist" "dist" > fri.kd = kdist(fri.kd) > fri.kd List of distances matrices call: kdist(fri.kd) class: kdist number of distances: 10 size: 16 labels: [1] "Q" "P" "R" "J" "E" "C" "D" "K" "B" "A" "G" "M" "L" "F" "H" "N" Hemiptera: euclidean distance Odonata: euclidean distance Trichoptera: euclidean distance Ephemeroptera: euclidean distance Coleoptera: euclidean distance Diptera: euclidean distance Hydracarina: euclidean distance Malacostraca: euclidean distance Mollusca: euclidean distance Oligochaeta: euclidean distance > s.corcircle(dudi.pca(as.data.frame(fri.kd), scan = FALSE)$co) > > # starting from several distances > data(ecomor) > d1 <- dist.binary(ecomor$habitat, 1) > d2 <- dist.prop(ecomor$forsub, 5) > d3 <- dist.prop(ecomor$diet, 5) > d4 <- dist.quant(ecomor$morpho, 3) > d5 <- taxo2phylog(ecomor$taxo)$Wdist > ecomor.kd <- kdist(d1, d2, d3, d4, d5) > names(ecomor.kd) = c("habitat", "forsub", "diet", "morpho", "taxo") > class(ecomor.kd) [1] "kdist" > s.corcircle(dudi.pca(as.data.frame(ecomor.kd), scan = FALSE)$co) > > data(bsetal97) > X <- prep.fuzzy.var(bsetal97$biol, bsetal97$biol.blo) 17 missing data found in block 1 14 missing data found in block 2 28 missing data found in block 3 8 missing data found in block 4 5 missing data found in block 5 19 missing data found in block 6 10 missing data found in block 7 5 missing data found in block 8 2 missing data found in block 9 12 missing data found in block 10 > w1 <- attr(X, "col.num") > w2 <- levels(w1) > w3 <- lapply(w2, function(x) dist.quant(X[,w1==x], method = 1)) > names(w3) <- names(attr(X, "col.blocks")) > w3 <- kdist(list = w3) > s.corcircle(dudi.pca(as.data.frame(w3), scan = FALSE)$co) > > data(rpjdl) > w1 = lapply(1:10, function(x) dist.binary(rpjdl$fau, method = x)) > w2 = c("JACCARD", "SOCKAL_MICHENER", "SOCKAL_SNEATH_S4", "ROGERS_TANIMOTO") > w2 = c(w2, "CZEKANOWSKI", "S9_GOWER_LEGENDRE", "OCHIAI", "SOKAL_SNEATH_S13") > w2 <- c(w2, "Phi_PEARSON", "S2_GOWER_LEGENDRE") > names(w1) <- w2 > w3 = kdist(list = w1) > w4 <- dudi.pca(as.data.frame(w3), scan = FALSE)$co > w4 Comp1 Comp2 JACCARD 0.9791013 0.18151963 SOCKAL_MICHENER 0.8693893 -0.48952277 SOCKAL_SNEATH_S4 0.9673038 0.17757093 ROGERS_TANIMOTO 0.8760634 -0.48095455 CZEKANOWSKI 0.9811773 0.18245217 S9_GOWER_LEGENDRE 0.8693893 -0.48952277 OCHIAI 0.9801507 0.18304997 SOKAL_SNEATH_S13 0.9882272 0.12063315 Phi_PEARSON 0.9955160 0.03143543 S2_GOWER_LEGENDRE 0.8342624 0.49634908 > > > > cleanEx(); ..nameEx <- "kdist2ktab" > > ### * kdist2ktab > > flush(stderr()); flush(stdout()) > > ### Name: kdist2ktab > ### Title: Transformation of K distance matrices (object 'kdist') into K > ### Euclidean representations (object 'ktab') > ### Aliases: kdist2ktab > ### Keywords: multivariate > > ### ** Examples > > data(friday87) > fri.w <- ktab.data.frame(friday87$fau, friday87$fau.blo, + tabnames = friday87$tab.names) > fri.kd <- lapply(1:10, function(x) dist.binary(fri.w[[x]], 10)) > names(fri.kd) <- substr(friday87$tab.names, 1, 4) > fri.kd <- kdist(fri.kd) > fri.ktab = kdist2ktab(kd = fri.kd) > fri.sepan = sepan(fri.ktab) > plot(fri.sepan, csub = 3) > > tapply(fri.sepan$Eig, fri.sepan$TC[,1], sum) 1 2 3 4 5 6 7 8 9 10 1 1 1 1 1 1 1 1 1 1 > # the sum of the eigenvalues is constant and equal to 1, for each K tables > > fri.statis <- statis(fri.ktab, scan = FALSE, nf = 2) > round(fri.statis$RV, dig = 2) Hemi Odon Tric Ephe Cole Dipt Hydr Mala Moll Olig Hemi 1.00 0.84 0.89 0.72 0.93 0.91 0.94 0.87 0.90 0.87 Odon 0.84 1.00 0.86 0.71 0.86 0.88 0.85 0.83 0.87 0.81 Tric 0.89 0.86 1.00 0.82 0.93 0.93 0.91 0.89 0.92 0.89 Ephe 0.72 0.71 0.82 1.00 0.73 0.83 0.74 0.81 0.83 0.79 Cole 0.93 0.86 0.93 0.73 1.00 0.94 0.94 0.89 0.92 0.87 Dipt 0.91 0.88 0.93 0.83 0.94 1.00 0.92 0.91 0.94 0.89 Hydr 0.94 0.85 0.91 0.74 0.94 0.92 1.00 0.88 0.93 0.86 Mala 0.87 0.83 0.89 0.81 0.89 0.91 0.88 1.00 0.92 0.86 Moll 0.90 0.87 0.92 0.83 0.92 0.94 0.93 0.92 1.00 0.86 Olig 0.87 0.81 0.89 0.79 0.87 0.89 0.86 0.86 0.86 1.00 > > fri.mfa <- mfa(fri.ktab, scan = FALSE, nf = 2) > fri.mcoa <- mcoa(fri.ktab, scan = FALSE, nf = 2) > > apply(fri.statis$RV, 1, mean) Hemi Odon Tric Ephe Cole Dipt Hydr Mala 0.8870267 0.8491046 0.9042958 0.7980208 0.9019560 0.9153542 0.8969580 0.8862786 Moll Olig 0.9084652 0.8693471 > fri.statis$RV.tabw [1] 0.3182568 0.3042336 0.3241214 0.2849738 0.3236518 0.3281335 0.3218042 [8] 0.3176219 0.3256389 0.3114247 > plot(apply(fri.statis$RV, 1, mean), fri.statis$RV.tabw) > plot(fri.statis$RV.tabw, fri.statis$RV.tabw) > > > > cleanEx(); ..nameEx <- "kdisteuclid" > > ### * kdisteuclid > > flush(stderr()); flush(stdout()) > > ### Name: kdisteuclid > ### Title: a way to obtain Euclidean distance matrices > ### Aliases: kdisteuclid > ### Keywords: multivariate utilities > > ### ** Examples > > w <- c(0.8,0.8,0.377350269,0.8,0.377350269,0.377350269) # see ref. > w <- kdist(w) > w1 <- c(kdisteuclid(kdist(w), "lingoes"), kdisteuclid(kdist(w), "cailliez"), + kdisteuclid(kdist(w), "quasi")) [1] "Lingoes constant = 0.0532050808642208" [1] "Cailliez constant = 0.200000000448660" [1] "First ev = 0.32 Last ev = -0.0532050808642208" > print(w, print = TRUE) List of distances matrices call: kdist(w) class: kdist number of distances: 1 size: 4 labels: [1] "1" "2" "3" "4" w: non euclidean distance 1 2 3 4 1 2 0.8000000 3 0.8000000 0.8000000 4 0.3773503 0.3773503 0.3773503 > print(w1, print = TRUE) List of distances matrices call: c.kdist(kdisteuclid(kdist(w), "lingoes"), kdisteuclid(kdist(w), "cailliez"), kdisteuclid(kdist(w), "quasi")) class: kdist number of distances: 3 size: 4 labels: [1] "1" "2" "3" "4" kdisteuclid(kdist(w), "lingoes").w: euclidean distance 1 2 3 4 1 2 0.8639503 3 0.8639503 0.8639503 4 0.4988020 0.4988020 0.4988020 kdisteuclid(kdist(w), "cailliez").w: euclidean distance 1 2 3 4 1 2 1.0000000 3 1.0000000 1.0000000 4 0.5773503 0.5773503 0.5773503 kdisteuclid(kdist(w), "quasi").w: euclidean distance 1 2 3 4 1 2 0.8000000 3 0.8000000 0.8000000 4 0.4618802 0.4618802 0.4618802 > > data(eurodist) > par(mfrow = c(1, 3)) > eu1 <- kdist(eurodist) # an object of class 'dist' > plot(data.frame(unclass(c(eu1, kdisteuclid(eu1, "quasi")))), asp = 1) [1] "First ev = 19538377.0895428 Last ev = -2251844.33173616" > title(main = "Quasi") ; abline(0,1) > plot(data.frame(unclass(c(eu1, kdisteuclid(eu1, "lingoes")))), asp = 1) [1] "Lingoes constant = 2251844.33173616" > title(main = "Lingoes") ; abline(0,1) > plot(data.frame(unclass(c(eu1, kdisteuclid(eu1, "cailliez")))), asp = 1) [1] "Cailliez constant = 2132.67849519794" > title(main = "Cailliez") ; abline(0,1) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "kplot" > > ### * kplot > > flush(stderr()); flush(stdout()) > > ### Name: kplot > ### Title: Generic Function for Multiple Graphs in a K-tables Analysis > ### Aliases: kplot > ### Keywords: multivariate hplot > > ### ** Examples > > methods(plot) [1] plot.Date* plot.HoltWinters* plot.POSIXct* [4] plot.POSIXlt* plot.TukeyHSD plot.acf* [7] plot.between plot.coinertia plot.corkdist [10] plot.data.frame* plot.decomposed.ts* plot.default [13] plot.dendrogram* plot.density plot.discrimin [16] plot.dpcoa plot.ecdf plot.factor* [19] plot.formula* plot.foucart plot.hclust* [22] plot.histogram* plot.isoreg* plot.krandtest [25] plot.lm plot.mcoa plot.medpolish* [28] plot.mfa plot.mlm plot.multispati [31] plot.niche plot.pcaiv plot.phylog [34] plot.ppr* plot.prcomp* plot.princomp* [37] plot.procuste plot.profile.nls* plot.pta [40] plot.randtest plot.rlq plot.rtest [43] plot.sepan plot.spec plot.spec.coherency [46] plot.spec.phase plot.statis plot.stepfun [49] plot.stl* plot.table* plot.ts [52] plot.tskernel* plot.within Non-visible functions are asterisked > methods(scatter) [1] scatter.acm scatter.coa scatter.dudi scatter.fca scatter.pco [6] scatter.smooth > methods(kplot) [1] kplot.foucart kplot.mcoa kplot.mfa kplot.pta [5] kplot.sepan kplot.sepan.coa kplot.statis > > > > cleanEx(); ..nameEx <- "kplot.foucart" > > ### * kplot.foucart > > flush(stderr()); flush(stdout()) > > ### Name: kplot.foucart > ### Title: Multiple Graphs for the Foucart's Correspondence Analysis > ### Aliases: kplot.foucart > ### Keywords: multivariate hplot > > ### ** Examples > > data(bf88) > fou1 <- foucart(bf88, scann = FALSE, nf = 3) > kplot(fou1, clab.r = 0, clab.c = 2, csub = 3) > > > > cleanEx(); ..nameEx <- "kplot.mcoa" > > ### * kplot.mcoa > > flush(stderr()); flush(stdout()) > > ### Name: kplot.mcoa > ### Title: Multiple Graphs for a Multiple Co-inertia Analysis > ### Aliases: kplot.mcoa > ### Keywords: multivariate hplot > > ### ** Examples > > data(friday87) > w1 <- data.frame(scale(friday87$fau, scal = FALSE)) > w2 <- ktab.data.frame(w1, friday87$fau.blo, + tabnames = friday87$tab.names) > mcoa1 <- mcoa(w2, "lambda1", scan = FALSE) > kplot(mcoa1, clab = 2, csub = 2, cpoi = 3, opt = "axis") > > kplot(mcoa1, mfrow = c(3,4), clab = 2, csub = 3, cpoi = 3) > > kplot(mcoa1, clab = 2, csub = 3, cpoi = 3, mfrow = c(3,4), + opt = "columns") > > > > cleanEx(); ..nameEx <- "kplot.mfa" > > ### * kplot.mfa > > flush(stderr()); flush(stdout()) > > ### Name: kplot.mfa > ### Title: Multiple Graphs for a Multiple Factorial Analysis > ### Aliases: kplot.mfa > ### Keywords: multivariate hplot > > ### ** Examples > > data(friday87) > w1 <- data.frame(scale(friday87$fau, scal = FALSE)) > w2 <- ktab.data.frame(w1, friday87$fau.blo, + tabnames = friday87$tab.names) > mfa1 <- mfa(w2, scann = FALSE) > kplot(mfa1) > > > > cleanEx(); ..nameEx <- "kplot.pta" > > ### * kplot.pta > > flush(stderr()); flush(stdout()) > > ### Name: kplot.pta > ### Title: Multiple Graphs for a Partial Triadic Analysis > ### Aliases: kplot.pta > ### Keywords: multivariate hplot > > ### ** Examples > > data(meaudret) > wit1 <- within(dudi.pca(meaudret$fau, scan = FALSE, scal = FALSE), + meaudret$plan$dat, scan = FALSE) > kta1 <- ktab.within(wit1, colnames = rep(c("S1","S2","S3","S4","S5"), 4)) > kta2 <- t(kta1) ; pta1 <- pta(kta2, scann = FALSE) > kplot(pta1, clab = 1.5, csub = 3) > kplot(pta1, clab = 1.5, csub = 3, which.graph = 3, mfrow = c(2,2)) > > > > cleanEx(); ..nameEx <- "kplot.sepan" > > ### * kplot.sepan > > flush(stderr()); flush(stdout()) > > ### Name: kplot.sepan > ### Title: Multiple Graphs for Separated Analyses in a K-tables > ### Aliases: kplot.sepan kplot.sepan.coa > ### Keywords: multivariate hplot > > ### ** Examples > > data(escopage) > w <- data.frame(scale(escopage$tab)) > w <- ktab.data.frame(w, escopage$blo, tabnames = escopage$tab.names) > sep1 <- sepan(w) > kplot(sep1, show = FALSE) > > data(friday87) > w <- data.frame(scale(friday87$fau, scal = FALSE)) > w <- ktab.data.frame(w, friday87$fau.blo, tabnames = friday87$tab.names) > kplot(sepan(w), clab.r = 1.25, clab.c = 0, csub = 3) > > data(microsatt) > w <- dudi.coa(data.frame(t(microsatt$tab)), scann = FALSE) > loci.fac <- factor(rep(microsatt$loci.names, microsatt$loci.eff)) > wit <- within(w, loci.fac, scann = FALSE) > microsatt.ktab <- ktab.within(wit) > kplot.sepan.coa(sepan(microsatt.ktab), show = FALSE, clab.c = 0, + mfrow = c(3,3), clab.r = 1.5) > > > > cleanEx(); ..nameEx <- "kplot.statis" > > ### * kplot.statis > > flush(stderr()); flush(stdout()) > > ### Name: kplot.statis > ### Title: Multiple Graphs of a STATIS Analysis > ### Aliases: kplot.statis > ### Keywords: multivariate hplot > > ### ** Examples > > data(jv73) > dudi1 <- dudi.pca(jv73$poi, scann = FALSE, scal = FALSE) > wit1 <- within(dudi1, jv73$fac.riv, scann = FALSE) > kta3 <- ktab.within(wit1) > data(jv73) > statis3 <- statis(kta3, scann = FALSE) > kplot(statis3, traj = TRUE, arrow = FALSE, unique = TRUE, + clab = 0, csub = 3, cpoi = 3) > > > > cleanEx(); ..nameEx <- "krandtest" > > ### * krandtest > > flush(stderr()); flush(stdout()) > > ### Name: krandtest > ### Title: Class of the Permutation Tests (in C). > ### Aliases: krandtest plot.krandtest print.krandtest > ### Keywords: methods > > ### ** Examples > > wkrandtest <- data.frame(eg1=c(0, rnorm(200))) > for (x0 in c(1.2,2.4,3.4,5.4,20.4)) { + wkrandtest <- cbind.data.frame(wkrandtest, c(x0, rnorm(200))) + } > names(wkrandtest) <- paste ("Test",1:6,sep="_") > class(wkrandtest) <- "krandtest" > wkrandtest class: krandtest test number: 6 permutation number: 200 test obs P(X<=obs) P(X>=obs) 1 Test_1 0 0.535 0.475 2 Test_2 1.2 0.895 0.115 3 Test_3 2.4 0.995 0.015 4 Test_4 3.4 1 0.005 5 Test_5 5.4 1 0.005 6 Test_6 20.4 1 0.005 > plot(wkrandtest) > > > > cleanEx(); ..nameEx <- "ktab" > > ### * ktab > > flush(stderr()); flush(stdout()) > > ### Name: ktab > ### Title: the class of objects 'ktab' (K-tables) > ### Aliases: ktab is.ktab c.ktab [.ktab print.ktab t.ktab row.names.ktab > ### row.names<-.ktab col.names col.names.ktab col.names<- > ### col.names<-.ktab tab.names tab.names.ktab tab.names<- > ### tab.names<-.ktab ktab.util.names ktab.util.addfactor<- > ### Keywords: multivariate > > ### ** Examples > > data(friday87) > wfri <- data.frame(scale(friday87$fau, scal = FALSE)) > wfri <- ktab.data.frame(wfri, friday87$fau.blo) > wfri[2:4] class: ktab tab number: 3 data.frame nrow ncol 1 Odonata 16 7 2 Trichoptera 16 13 3 Ephemeroptera 16 4 vector length mode content 4 $lw 16 numeric row weigths 5 $cw 24 numeric column weights 6 $blo 3 numeric column numbers 7 $tabw 0 NULL array weights data.frame nrow ncol content 8 $TL 48 2 Factors Table number Line number 9 $TC 24 2 Factors Table number Col number 10 $T4 12 2 Factors Table number 1234 11 $call: "[.ktab"(object = wfri, selection = 2:4) names : Odonata : B1 B2 B3 B4 B5 B6 B7 Trichoptera : C1 C2 C3 C4 C5 C6 C7 C8 C9 Ca Cb Cc Cd Ephemeroptera : D1 D2 D3 D4 Col weigths : Odonata : 1 1 1 1 1 1 1 Trichoptera : 1 1 1 1 1 1 1 1 1 1 1 1 1 Ephemeroptera : 1 1 1 1 Row weigths : 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 > c(wfri[2:4], wfri[5]) class: ktab tab number: 4 data.frame nrow ncol 1 Odonata 16 7 2 Trichoptera 16 13 3 Ephemeroptera 16 4 4 Coleoptera 16 13 vector length mode content 5 $lw 16 numeric row weigths 6 $cw 37 numeric column weights 7 $blo 4 numeric column numbers 8 $tabw 0 NULL array weights data.frame nrow ncol content 9 $TL 64 2 Factors Table number Line number 10 $TC 37 2 Factors Table number Col number 11 $T4 16 2 Factors Table number 1234 12 $call: c.ktab(wfri[2:4], wfri[5]) names : Odonata : B1 B2 B3 B4 B5 B6 B7 Trichoptera : C1 C2 C3 C4 C5 C6 C7 C8 C9 Ca Cb Cc Cd Ephemeroptera : D1 D2 D3 D4 Coleoptera : E1 E2 E3 E4 E5 E6 E7 E8 E9 Ea Eb Ec Ed Col weigths : Odonata : 1 1 1 1 1 1 1 Trichoptera : 1 1 1 1 1 1 1 1 1 1 1 1 1 Ephemeroptera : 1 1 1 1 Coleoptera : 1 1 1 1 1 1 1 1 1 1 1 1 1 Row weigths : 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 > > data(meaudret) > wit1 <- within.pca(meaudret$mil, meaudret$plan$dat, scan = FALSE, + scal = "partial") > kta1 <- ktab.within(wit1, colnames = rep(c("S1","S2","S3","S4","S5"), 4)) > kta2 <- t(kta1) > kplot(sepan(kta2), clab.r = 1.5, clab.c = 0.75) > > > > cleanEx(); ..nameEx <- "ktab.data.frame" > > ### * ktab.data.frame > > flush(stderr()); flush(stdout()) > > ### Name: ktab.data.frame > ### Title: Creation of K-tables from a data frame > ### Aliases: ktab.data.frame > ### Keywords: multivariate > > ### ** Examples > > data(escopage) > wescopage <- data.frame(scalewt(escopage$tab)) > wescopage <- ktab.data.frame(wescopage, escopage$blo, + tabnames = escopage$tab.names) > plot(sepan(wescopage)) > data(friday87) > w <- data.frame(scale(friday87$fau, scal = FALSE)) > w <- ktab.data.frame(w, friday87$fau.blo, tabnames = friday87$tab.names) > kplot(sepan(w)) > > > > cleanEx(); ..nameEx <- "ktab.list.df" > > ### * ktab.list.df > > flush(stderr()); flush(stdout()) > > ### Name: ktab.list.df > ### Title: Creating a K-tables from a list of data frames. > ### Aliases: ktab.list.df > ### Keywords: multivariate > > ### ** Examples > > data(jv73) > l0 <- split(jv73$morpho, jv73$fac.riv) > l0 <- lapply(l0, function(x) data.frame(t(scalewt(x)))) > kta <- ktab.list.df(l0) > kplot(sepan(kta[c(2,5,7,10)]), perm = TRUE, clab.r = 1, clab.c = 1.5) > > > > cleanEx(); ..nameEx <- "ktab.list.dudi" > > ### * ktab.list.dudi > > flush(stderr()); flush(stdout()) > > ### Name: ktab.list.dudi > ### Title: Creation of a K-tables from a list of duality diagrams > ### Aliases: ktab.list.dudi > ### Keywords: multivariate > > ### ** Examples > > data(euro123) > pca1 <- dudi.pca(euro123$in78, scale = FALSE, scann = FALSE) > pca2 <- dudi.pca(euro123$in86, scale = FALSE, scann = FALSE) > pca3 <- dudi.pca(euro123$in97, scale = FALSE, scann = FALSE) > ktabeuro <- ktab.list.dudi(list(pca1, pca2, pca3), + tabnames = c("1978","1986","1997")) > kplot(sepan(ktabeuro), mfr = c(2,2), clab.c = 1.5) > > data(meaudret) > w1 <- split(meaudret$mil,meaudret$plan$dat) > ll <- lapply(w1, dudi.pca, scann = FALSE) > kta <- ktab.list.dudi(ll, rownames <- paste("Station", 1:5, sep="")) > kplot(sepan(kta), clab.r = 1.5, clab.c = 0.75) > > data(jv73) > w <- split(jv73$poi, jv73$fac.riv) > wjv73poi <- lapply(w, dudi.pca, scal = FALSE, scan = FALSE) > wjv73poi <- lapply(wjv73poi, t) > wjv73poi <- ktab.list.dudi(wjv73poi) > kplot(sepan(wjv73poi), permut = TRUE, traj = TRUE) > > > > cleanEx(); ..nameEx <- "ktab.match2ktabs" > > ### * ktab.match2ktabs > > flush(stderr()); flush(stdout()) > > ### Name: ktab.match2ktabs > ### Title: STATIS and Co-Inertia : Analysis of a series of paired > ### ecological tables > ### Aliases: ktab.match2ktabs > ### Keywords: multivariate > > ### ** Examples > > data(meau) > wit1 <- within.pca(meau$mil, meau$plan$dat, scan = FALSE, scal = "total") > pcafau <- dudi.pca(meau$fau, scale = FALSE, scan = FALSE, nf = 2) > wit2 <- within(pcafau, meau$plan$dat, scan = FALSE, nf = 2) > kta1 <- ktab.within(wit1, colnames = rep(c("S1","S2","S3","S4","S5","S6"), 4)) > kta2 <- ktab.within(wit2, colnames = rep(c("S1","S2","S3","S4","S5","S6"), 4)) > kcoi <- ktab.match2ktabs(kta1, kta2) > ptacoi <- pta(kcoi, scan = FALSE, nf = 2) > plot(ptacoi) > kplot(ptacoi) > > > > cleanEx(); ..nameEx <- "ktab.within" > > ### * ktab.within > > flush(stderr()); flush(stdout()) > > ### Name: ktab.within > ### Title: Process to go from a Within Analysis to a K-tables > ### Aliases: ktab.within > ### Keywords: multivariate > > ### ** Examples > > data(bacteria) > w1 <- data.frame(t(bacteria$espcodon)) > dudi1 <- dudi.coa(w1, scann = FALSE, nf = 4) > wit1 <- within(dudi1, bacteria$code, scannf = FALSE) > kta1 <- ktab.within(wit1) > plot(statis(kta1, scann = FALSE)) > > kta2 <- kta1[kta1$blo>3] > kplot(mfa(kta2, scann = FALSE)) > > > > cleanEx(); ..nameEx <- "lascaux" > > ### * lascaux > > flush(stderr()); flush(stdout()) > > ### Name: lascaux > ### Title: Genetic/Environment and types of variables > ### Aliases: lascaux > ### Keywords: datasets > > ### ** Examples > > data(lascaux) > par(mfrow = c(2,2)) > barplot(dudi.pca(lascaux$meris, scan = FALSE)$eig) > title(main = "Meristic") > barplot(dudi.pca(lascaux$colo, scan = FALSE)$eig) > title(main = "Coloration") > barplot(dudi.pca(na.omit(lascaux$morpho), scan = FALSE)$eig) > title(main = "Morphometric") > barplot(dudi.acm(na.omit(lascaux$orne), scan = FALSE)$eig) > title(main = "Ornemental") > par(mfrow = c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "lingoes" > > ### * lingoes > > flush(stderr()); flush(stdout()) > > ### Name: lingoes > ### Title: Transformation of a Distance Matrix for becoming Euclidean > ### Aliases: lingoes > ### Keywords: array multivariate > > ### ** Examples > > data(capitales) > d0 <- as.dist(capitales$df) > is.euclid(d0) # FALSE [1] FALSE > d1 <- lingoes(d0, TRUE) Lingoes constant = 2120982 > # Lingoes constant = 2120982 > is.euclid(d1) # TRUE [1] TRUE > plot(d0, d1) > x0 <- sort(unclass(d0)) > lines(x0, sqrt(x0^2 + 2 * 2120982), lwd = 3) > > is.euclid(sqrt(d0^2 + 2 * 2120981), tol = 1e-10) # FALSE [1] FALSE > is.euclid(sqrt(d0^2 + 2 * 2120982), tol = 1e-10) # FALSE [1] FALSE > is.euclid(sqrt(d0^2 + 2 * 2120983), tol = 1e-10) [1] TRUE > # TRUE the smaller constant > > > > cleanEx(); ..nameEx <- "lizards" > > ### * lizards > > flush(stderr()); flush(stdout()) > > ### Name: lizards > ### Title: Phylogeny and quantitative traits of lizards > ### Aliases: lizards > ### Keywords: datasets > > ### ** Examples > > data(lizards) > w <- data.frame(scalewt(log(lizards$traits))) > par(mfrow = c(1,2)) > wphy <- newick2phylog(lizards$hprA) > table.phylog(w, wphy, csi = 3) > wphy <- newick2phylog(lizards$hprB) > table.phylog(w, wphy, csi = 3) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "macaca" > > ### * macaca > > flush(stderr()); flush(stdout()) > > ### Name: macaca > ### Title: Landmarks > ### Aliases: macaca > ### Keywords: datasets > > ### ** Examples > > data(macaca) > par(mfrow = c(2,2)) > s.match(macaca$xy1, macaca$xy2, clab = 0) > pro1 <- procuste(macaca$xy1, macaca$xy2, scal = FALSE) > s.match(pro1$tab1, pro1$rot2, clab = 0.7) > s.match(pro1$tab2, pro1$rot1, clab = 0.7) > pro2 <- procuste(macaca$xy1, macaca$xy2) > s.match(pro2$tab2, pro2$rot1, clab = 0.7) > par(mfrow = c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "macon" > > ### * macon > > flush(stderr()); flush(stdout()) > > ### Name: macon > ### Title: Wine Tasting > ### Aliases: macon > ### Keywords: datasets > > ### ** Examples > > data(macon) > s.corcircle(dudi.pca(macon, scan = FALSE)$co) > > > > cleanEx(); ..nameEx <- "mafragh" > > ### * mafragh > > flush(stderr()); flush(stdout()) > > ### Name: mafragh > ### Title: Phyto-Ecological Survey > ### Aliases: mafragh > ### Keywords: datasets > > ### ** Examples > > data(mafragh) > par(mfrow = c(3,2)) > s.label(mafragh$xy, inc = FALSE, neig = mafragh$neig, + sub = "Samples & Neighbourhood graph") > coa1 <- dudi.coa(mafragh$flo, scan = FALSE) > s.value(mafragh$xy, coa1$li[,1], sub = "Axis 1 - COA") > pca1 <- dudi.pca(mafragh$xy, scan = FALSE) > s.value(mafragh$xy, pca1$li[,1], sub = "Axis 1 - PCA") > s.class(pca1$li, mafragh$partition, sub = "Plane 1-2 - PCA") > s.class(coa1$li, mafragh$partition, sub = "Plane 1-2 - COA") > s.chull(mafragh$xy, mafragh$partition, optchull = 1) > par(mfrow=c(1,1)) > > ## Not run: > ##D link1 <- area2link(mafragh$area) > ##D neig1 <- neig(mat01 = 1*(link1>0)) > ##D nb1 <- neig2nb(neig1) > ##D par(mfrow = c(2,1)) > ##D area.plot(mafragh$area,center = mafragh$xy,clab=0.75) > ##D area.plot(mafragh$area,center = mafragh$xy,graph=neig1) > ##D if (require(maptools, quiet = TRUE) & require(spdep, quiet = TRUE)) { > ##D lw1 <- apply(link1,1,function(x) x[x>0]) > ##D listw1 <- nb2listw(nb1,lw1) > ##D coa1 <- dudi.coa(mafragh$flo, scan = FALSE, nf = 4) > ##D ms1 <- multispati(coa1, listw1, scan = FALSE, nfp = 2, nfn = 0) > ##D summary(ms1) > ##D par(mfrow = c(2,2)) > ##D barplot(coa1$eig) > ##D barplot(ms1$eig) > ##D s.corcircle(ms1$as) > ##D plot(coa1$li[,1], ms1$li[,1]) > ##D } > ##D par(mfrow = c(1,1)) > ## End(Not run) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "mantel.randtest" > > ### * mantel.randtest > > flush(stderr()); flush(stdout()) > > ### Name: mantel.randtest > ### Title: Mantel test (correlation between two distance matrices (in C).) > ### Aliases: mantel.randtest > ### Keywords: array nonparametric > > ### ** Examples > > data(yanomama) > gen <- quasieuclid(as.dist(yanomama$gen)) > geo <- quasieuclid(as.dist(yanomama$geo)) > plot(r1 <- mantel.randtest(geo,gen), main = "Mantel's test") > r1 Monte-Carlo test Observation: 0.5095199 Call: mantel.randtest(m1 = geo, m2 = gen) Based on 999 replicates Simulated p-value: 0.002 > > > > cleanEx(); ..nameEx <- "mantel.rtest" > > ### * mantel.rtest > > flush(stderr()); flush(stdout()) > > ### Name: mantel.rtest > ### Title: Mantel test (correlation between two distance matrices (in R).) > ### Aliases: mantel.rtest > ### Keywords: array nonparametric > > ### ** Examples > > data(yanomama) > gen <- quasieuclid(as.dist(yanomama$gen)) > geo <- quasieuclid(as.dist(yanomama$geo)) > plot(r1 <- mantel.rtest(geo,gen), main = "Mantel's test") > r1 Monte-Carlo test Observation: 0.5095199 Call: mantel.rtest(m1 = geo, m2 = gen) Based on 99 replicates Simulated p-value: 0.01 > > > > cleanEx(); ..nameEx <- "maples" > > ### * maples > > flush(stderr()); flush(stdout()) > > ### Name: maples > ### Title: Phylogeny and quantitative traits of flowers > ### Aliases: maples > ### Keywords: datasets > > ### ** Examples > > data(maples) > phy <- newick2phylog(maples$tre) > dom <- maples$tab$Dom > bif <- maples$tab$Bif > orthogram(dom, phylog = phy) class: krandtest test number: 4 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 R2Max 0.664 1 0.001 2 SkR2k 2.907 0.001 1 3 Dmax 0.649 1 0.001 4 SCE 2.676 1 0.001 > orthogram(bif, phylog = phy) class: krandtest test number: 4 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 R2Max 0.606 1 0.002 2 SkR2k 2.962 0.001 1 3 Dmax 0.666 1 0.001 4 SCE 2.538 1 0.001 > par(mfrow = c(1,2)) > dotchart.phylog(phy, dom) > dotchart.phylog(phy, bif, clabel.nodes = 0.7) > par(mfrow = c(1,1)) > plot(bif,dom,pch = 20) > abline(lm(dom~bif)) > summary(lm(dom~bif)) Call: lm(formula = dom ~ bif) Residuals: Min 1Q Median 3Q Max -0.14842 -0.06725 0.00496 0.07620 0.11130 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.259967 0.105927 11.895 4.88e-09 *** bif -0.008654 0.001699 -5.093 0.000132 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.08404 on 15 degrees of freedom Multiple R-Squared: 0.6336, Adjusted R-squared: 0.6091 F-statistic: 25.94 on 1 and 15 DF, p-value: 0.0001324 > if (require(ape, quiet = TRUE)){ + cor.test(bif,dom) + phylo <- read.tree(text = maples$tre) + pic.bif <- pic(bif, phylo) + pic.dom <- pic(dom, phylo) + cor.test(pic.bif, pic.dom)} Loading required package: gee Loading required package: nlme Loading required package: lattice Pearson's product-moment correlation data: pic.bif and pic.dom t = -1.5823, df = 14, p-value = 0.1359 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: -0.7419510 0.1316186 sample estimates: cor -0.3894993 > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "mariages" > > ### * mariages > > flush(stderr()); flush(stdout()) > > ### Name: mariages > ### Title: Correspondence Analysis Table > ### Aliases: mariages > ### Keywords: datasets > > ### ** Examples > > data(mariages) > par(mfrow = c(2,2)) > w <- dudi.coa(mariages, scan = FALSE, nf = 3) > scatter(w, met = 1, posi = "bottom") > scatter(w, met = 2, posi = "bottom") > scatter(w, met = 3, posi = "bottom") > score(w, 3) > par(mfrow = c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "mcoa" > > ### * mcoa > > flush(stderr()); flush(stdout()) > > ### Name: mcoa > ### Title: Multiple CO-inertia Analysis > ### Aliases: mcoa print.mcoa summary.mcoa plot.mcoa > ### Keywords: multivariate > > ### ** Examples > > data(friday87) > w1 <- data.frame(scale(friday87$fau, scal = FALSE)) > w2 <- ktab.data.frame(w1, friday87$fau.blo, tabnames = friday87$tab.names) > mcoa1 <- mcoa(w2, "lambda1", scan = FALSE) > mcoa1 Multiple Co-inertia Analysis list of class mcoa $pseudoeig: 16 pseudo eigen values 6.459 4.07 1.914 1.644 0.98 ... $call: mcoa(X = w2, option = "lambda1", scannf = FALSE) $nf: 3 axis saved data.frame nrow ncol content 1 $SynVar 16 3 synthetic scores 2 $axis 91 3 co-inertia axis 3 $Tli 160 3 co-inertia coordinates 4 $Tl1 160 3 co-inertia normed scores 5 $Tax 40 3 inertia axes onto co-inertia axis 6 $Tco 91 3 columns onto synthetic scores 7 $TL 160 2 factors for Tli Tl1 8 $TC 91 2 factors for Tco 9 $T4 40 2 factors for Tax 10 $lambda 10 3 eigen values (separate analysis) 11 $cov2 10 3 pseudo eigen values (synthetic analysis) other elements: NULL > summary(mcoa1) Multiple Co-inertia Analysis Array n° 1 Hemiptera Rows 16 Cols 11 Iner Iner+ Var Var+ cos2 cov2 1 1 1 0.688 0.688 0.68 0.468 2 0.748 1.748 0.979 1.667 0.82 0.803 3 0.384 2.132 0.356 2.023 0.668 0.238 Array n° 2 Odonata Rows 16 Cols 7 Iner Iner+ Var Var+ cos2 cov2 1 1 1 0.839 0.839 0.853 0.715 2 0.856 1.856 0.873 1.712 0.681 0.594 3 0.573 2.43 0.268 1.979 0.444 0.119 Array n° 3 Trichoptera Rows 16 Cols 13 Iner Iner+ Var Var+ cos2 cov2 1 1 1 0.941 0.941 0.76 0.715 2 0.395 1.395 0.361 1.302 0.715 0.258 3 0.238 1.634 0.176 1.478 0.726 0.128 Array n° 4 Ephemeroptera Rows 16 Cols 4 Iner Iner+ Var Var+ cos2 cov2 1 1 1 0.942 0.942 0.915 0.861 2 0.697 1.697 0.752 1.694 0.53 0.399 3 0.079 1.777 0.035 1.728 0.134 0.005 Array n° 5 Coleoptera Rows 16 Cols 13 Iner Iner+ Var Var+ cos2 cov2 1 1 1 0.691 0.691 0.695 0.481 2 0.683 1.683 0.659 1.351 0.663 0.437 3 0.527 2.21 0.579 1.93 0.804 0.466 Array n° 6 Diptera Rows 16 Cols 22 Iner Iner+ Var Var+ cos2 cov2 1 1 1 0.951 0.951 0.854 0.812 2 0.478 1.478 0.393 1.343 0.584 0.23 3 0.369 1.847 0.239 1.582 0.665 0.159 Array n° 7 Hydracarina Rows 16 Cols 4 Iner Iner+ Var Var+ cos2 cov2 1 1 1 0.915 0.915 0.693 0.634 2 0.87 1.87 0.851 1.766 0.548 0.466 3 0.591 2.461 0.667 2.434 0.86 0.574 Array n° 8 Malacostraca Rows 16 Cols 3 Iner Iner+ Var Var+ cos2 cov2 1 1 1 0.876 0.876 0.751 0.657 2 0.529 1.529 0.653 1.528 0.672 0.438 3 0.154 1.683 0.155 1.683 0.075 0.012 Array n° 9 Mollusca Rows 16 Cols 8 Iner Iner+ Var Var+ cos2 cov2 1 1 1 0.974 0.974 0.773 0.753 2 0.286 1.286 0.261 1.235 0.805 0.21 3 0.207 1.493 0.173 1.408 0.481 0.083 Array n° 10 Oligochaeta Rows 16 Cols 6 Iner Iner+ Var Var+ cos2 cov2 1 1 1 0.755 0.755 0.482 0.364 2 0.799 1.799 0.443 1.198 0.53 0.234 3 0.383 2.183 0.244 1.442 0.539 0.132 > plot(mcoa1) > > > > cleanEx(); ..nameEx <- "meau" > > ### * meau > > flush(stderr()); flush(stdout()) > > ### Name: meau > ### Title: Ecological Data : sites-variables, sites-species, where and when > ### Aliases: meau > ### Keywords: datasets > > ### ** Examples > > data(meau) > par(mfrow = c(2,2)) > pca1 <- dudi.pca(meau$mil, scan = FALSE, nf = 4) > s.class(pca1$li, meau$plan$dat, + sub = "Principal Component Analysis") > pca2 <- between(pca1, meau$plan$dat, scan = FALSE, nf = 2) > s.class(pca2$ls, meau$plan$dat, sub = "Between dates Principal Component Analysis") > s.corcircle(pca1$co) > s.corcircle(pca2$as) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "meaudret" > > ### * meaudret > > flush(stderr()); flush(stdout()) > > ### Name: meaudret > ### Title: Ecological Data : sites-variables, sites-species, where and when > ### Aliases: meaudret > ### Keywords: datasets > > ### ** Examples > > data(meaudret) > par(mfrow = c(2,2)) > pca1 <- dudi.pca(meaudret$mil, scan = FALSE, nf = 4) > s.class(pca1$li, meaudret$plan$dat, + sub = "Principal Component Analysis") > pca2 <- between(pca1, meaudret$plan$dat, scan = FALSE, nf = 2) > s.class(pca2$ls, meaudret$plan$dat, sub = "Between dates Principal Component Analysis") > s.corcircle(pca1$co) > s.corcircle(pca2$as) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "mfa" > > ### * mfa > > flush(stderr()); flush(stdout()) > > ### Name: mfa > ### Title: Multiple Factorial Analysis > ### Aliases: mfa print.mfa plot.mfa summary.mfa > ### Keywords: multivariate > > ### ** Examples > > data(friday87) > w1 <- data.frame(scale(friday87$fau, scal = FALSE)) > w2 <- ktab.data.frame(w1, friday87$fau.blo, + tabnames = friday87$tab.names) > mfa1 <- mfa(w2, scann = FALSE) > mfa1 Multiple Factorial Analysis list of class function $call: mfa(X = w2, scannf = FALSE) $nf: 3 axis-components saved vector length mode content 1 $tab.names 10 character tab names 2 $blo 10 numeric column number 3 $rank 1 numeric tab rank 4 $eig 15 numeric eigen values 5 $lw 16 numeric row weights 6 $tabw 0 NULL array weights data.frame nrow ncol content 1 $tab 16 91 modified array 2 $li 16 3 row coordinates 3 $l1 16 3 row normed scores 4 $co 91 3 column coordinates 5 $c1 91 3 column normed scores 6 $lisup 160 3 row coordinates from each table 7 $TL 160 2 factors for li l1 8 $TC 91 2 factors for co c1 9 $T4 40 2 factors for T4comp 10 $T4comp 40 3 component projection 11 $link 10 3 link array-total other elements: NULL > plot(mfa1) > > data(escopage) > w <- data.frame(scale(escopage$tab)) > w <- ktab.data.frame(w, escopage$blo, tabnames = escopage$tab.names) > plot(mfa(w, scann = FALSE)) > > > > cleanEx(); ..nameEx <- "microsatt" > > ### * microsatt > > flush(stderr()); flush(stdout()) > > ### Name: microsatt > ### Title: Genetic Relationships between cattle breeds with microsatellites > ### Aliases: microsatt > ### Keywords: datasets > > ### ** Examples > > ## Not run: > ##D data(microsatt) > ##D fac <- factor(rep(microsatt$loci.names, microsatt$loci.eff)) > ##D w <- dudi.coa(data.frame(t(microsatt$tab)), scann = FALSE) > ##D wit <- within(w, fac, scann = FALSE) > ##D microsatt.ktab <- ktab.within(wit) > ##D > ##D plot(sepan(microsatt.ktab)) # 9 separated correspondence analyses > ##D plot(mcoa(microsatt.ktab, scan = FALSE)) > ##D plot(mfa(microsatt.ktab, scan = FALSE)) > ##D plot(statis(microsatt.ktab, scan = FALSE)) > ## End(Not run) > > > cleanEx(); ..nameEx <- "mjrochet" > > ### * mjrochet > > flush(stderr()); flush(stdout()) > > ### Name: mjrochet > ### Title: Phylogeny and quantitative traits of teleos fishes > ### Aliases: mjrochet > ### Keywords: datasets > > ### ** Examples > > data(mjrochet) > mjrochet.phy <- newick2phylog(mjrochet$tre) > tab <- log((mjrochet$tab)) > tab0 <- data.frame(scalewt(tab)) > table.phylog(tab0, mjrochet.phy, csi = 2, clabel.r = 0.75) > orthogram(tab0[,1], ortho = mjrochet.phy$Bscores) class: krandtest test number: 4 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 R2Max 0.15 0.881 0.121 2 SkR2k 14.71 0.001 1 3 Dmax 0.352 1 0.001 4 SCE 2.527 0.999 0.003 > > > > cleanEx(); ..nameEx <- "mld" > > ### * mld > > flush(stderr()); flush(stdout()) > > ### Name: mld > ### Title: Multi Level Decomposition of unidimensional data > ### Aliases: mld haar2level > ### Keywords: ts spatial > > ### ** Examples > > ## Not run: > ##D # decomposition of a time serie > ##D data(co2) > ##D x <- log(co2) > ##D orthobas <- orthobasis.line(length(x)) > ##D level<-rep("D", 467) > ##D level[1:3]<-rep("A", 3) > ##D level[c(77,78,79,81)]<-rep("B", 4) > ##D level[156]<-"C" > ##D level<-as.factor(level) > ##D res <- mld(x, orthobas, level) > ##D sum(scale(x, scale = FALSE) - apply(res, 1, sum)) > ## End(Not run) > # decomposition of a biological trait on a phylogeny > data(palm) > vfruit<-palm$traits$vfruit > vfruit<-scalewt(vfruit) > palm.phy<-newick2phylog(palm$tre) > level <- rep("F", 65) > level[c(4, 21, 3, 6, 13)] <- LETTERS[1:5] > level <- as.factor(level) > res <- mld(as.vector(vfruit), palm.phy$Bscores, level, + phylog = palm.phy, clabel.nod = 0.7, f.phylog=0.8, + csize = 2, clabel.row = 0.7, clabel.col = 0.7) > > > > cleanEx(); ..nameEx <- "mollusc" > > ### * mollusc > > flush(stderr()); flush(stdout()) > > ### Name: mollusc > ### Title: Faunistic Communities and Sampling Experiment > ### Aliases: mollusc > ### Keywords: datasets > > ### ** Examples > > data(mollusc) > coa1 <- dudi.coa(log(mollusc$fau + 1), scannf = FALSE, nf = 3) > par(mfrow = c(2,2)) > s.chull(coa1$li, mollusc$plan$site, 2, 3, opt = 1, cpoi = 1) > s.chull(coa1$li, mollusc$plan$season, 2, 3, opt = 1, cpoi = 1) > s.chull(coa1$li, mollusc$plan$method, 2, 3, opt = 1, cpoi = 1) > s.chull(coa1$li, mollusc$plan$duration, 2, 3, opt = 1, cpoi = 1) > par(mfrow=c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "monde84" > > ### * monde84 > > flush(stderr()); flush(stdout()) > > ### Name: monde84 > ### Title: Global State of the World in 1984 > ### Aliases: monde84 > ### Keywords: datasets > > ### ** Examples > > data(monde84) > X <- cbind.data.frame(lpib = log(monde84$pib), monde84$croipop) > Y <- cbind.data.frame(lmorta = log(monde84$morta), + lanal = log(monde84$anal + 1), rscol = sqrt(100 - monde84$scol)) > pcaY <- dudi.pca(Y, scan = FALSE) > pcaiv1 <- pcaiv(pcaY, X0 <- scale(X), scan = FALSE) > sum(cor(pcaiv1$l1[,1], Y0 <- scale(Y))^2) [1] 2.227037 > pcaiv1$eig[1] #the same [1] 2.227037 > > > > cleanEx(); ..nameEx <- "morphosport" > > ### * morphosport > > flush(stderr()); flush(stdout()) > > ### Name: morphosport > ### Title: Athletes' Morphology > ### Aliases: morphosport > ### Keywords: datasets > > ### ** Examples > > data(morphosport) > plot(discrimin(dudi.pca(morphosport$tab, scan = FALSE), morphosport$sport, scan = FALSE)) > > > > cleanEx(); ..nameEx <- "mstree" > > ### * mstree > > flush(stderr()); flush(stdout()) > > ### Name: mstree > ### Title: Minimal Spanning Tree > ### Aliases: mstree > ### Keywords: utilities > > ### ** Examples > > data(mafragh) > maf.coa = dudi.coa(mafragh$flo, scan = FALSE) > maf.mst = mstree(dist.dudi(maf.coa), 1) > s.label(maf.coa$li, clab = 0, cpoi = 2, neig = maf.mst, cnei = 1) > > xy = data.frame(x = runif(20), y = runif(20)) > par(mfrow = c(2,2)) > for (k in 1:4) { + neig = mstree (dist.quant(xy,1), k) + s.label(xy, xlim = c(0,1), ylim = c(0,1), addax = FALSE, neig = neig) + } > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "multispati" > > ### * multispati > > flush(stderr()); flush(stdout()) > > ### Name: multispati > ### Title: Multivariate spatial analysis > ### Aliases: multispati plot.multispati summary.multispati print.multispati > ### Keywords: multivariate spatial > > ### ** Examples > > ## Not run: > ##D if (require(maptools, quiet = TRUE) & require(spdep, quiet = TRUE)) { > ##D data(mafragh) > ##D maf.xy <- mafragh$xy > ##D maf.flo <- mafragh$flo > ##D maf.listw <- nb2listw(neig2nb(mafragh$neig)) > ##D s.label(maf.xy, neig = mafragh$neig, clab = 0.75) > ##D maf.coa <- dudi.coa(maf.flo,scannf = FALSE) > ##D multispati.randtest(maf.coa, maf.listw) > ##D maf.coa.ms <- multispati(maf.coa, maf.listw, scannf = FALSE, nfposi = 2, nfnega = 2) > ##D summary(maf.coa.ms) > ##D par(mfrow = c(1,3)) > ##D barplot(maf.coa$eig) > ##D barplot(maf.coa.ms$eig) > ##D s.corcircle(maf.coa.ms$as) > ##D > ##D par(mfrow = c(2,2)) > ##D s.value(maf.xy, -maf.coa$li[,1]) > ##D s.value(maf.xy, -maf.coa$li[,2]) > ##D s.value(maf.xy, maf.coa.ms$li[,1]) > ##D s.value(maf.xy, maf.coa.ms$li[,2]) > ##D par(mfrow = c(1,1)) > ##D > ##D par(mfrow = c(1,2)) > ##D w1 <- -maf.coa$li[,1:2] > ##D w1m <- apply(w1, 2, lag.listw, x = maf.listw) > ##D s.match(w1, w1m, clab = 0.75) > ##D w1.ms <- maf.coa.ms$li[,1:2] > ##D w1.msm <- apply(w1.ms, 2, lag.listw, x = maf.listw) > ##D s.match(w1.ms, w1.msm, clab = 0.75) > ##D par(mfrow = c(1,1)) > ##D > ##D maf.pca <- dudi.pca(mafragh$mil, scannf = FALSE) > ##D multispati.randtest(maf.pca, maf.listw) > ##D maf.pca.ms <- multispati(maf.pca, maf.listw, scannf=FALSE) > ##D plot(maf.pca.ms) > ##D } > ## End(Not run) > > > cleanEx(); ..nameEx <- "multispati.randtest" > > ### * multispati.randtest > > flush(stderr()); flush(stdout()) > > ### Name: multispati.randtest > ### Title: Multivariate spatial autocorrelation test (in C) > ### Aliases: multispati.randtest > ### Keywords: multivariate spatial nonparametric > > ### ** Examples > > if (require(maptools, quiet = TRUE) & require(spdep, quiet = TRUE)) { + data(mafragh) + maf.xy <- mafragh$xy + maf.flo <- mafragh$flo + maf.listw <- nb2listw(neig2nb(mafragh$neig)) + s.label(maf.xy, neig = mafragh$neig, clab = 0.75) + maf.coa <- dudi.coa(maf.flo,scannf = FALSE) + multispati.randtest(maf.coa, maf.listw) + } Loading required package: foreign Loading required package: tripack Loading required package: SparseM [1] "SparseM library loaded" Monte-Carlo test Observation: 0.2075949 Call: multispati.randtest(dudi = maf.coa, listw = maf.listw) Based on 999 replicates Simulated p-value: 0.001 > > > > cleanEx(); ..nameEx <- "multispati.rtest" > > ### * multispati.rtest > > flush(stderr()); flush(stdout()) > > ### Name: multispati.rtest > ### Title: Multivariate spatial autocorrelation test > ### Aliases: multispati.rtest > ### Keywords: multivariate spatial nonparametric > > ### ** Examples > > if(require(spdep, quiet = TRUE)){ + data(mafragh) + maf.xy <- mafragh$xy + maf.flo <- mafragh$flo + maf.listw <- nb2listw(neig2nb(mafragh$neig)) + s.label(maf.xy, neig = mafragh$neig, clab = 0.75) + maf.coa <- dudi.coa(maf.flo, scannf = FALSE) + multispati.rtest(maf.coa, maf.listw) + } Loading required package: tripack Loading required package: maptools Loading required package: foreign Loading required package: SparseM Monte-Carlo test Observation: 0.2075949 Call: multispati.rtest(dudi = maf.coa, listw = maf.listw) Based on 99 replicates Simulated p-value: 0.01 > > > > cleanEx(); ..nameEx <- "neig" > > ### * neig > > flush(stderr()); flush(stdout()) > > ### Name: neig > ### Title: Neighbourhood Graphs > ### Aliases: neig neig.util.GtoL neig.util.LtoG print.neig summary.neig > ### scores.neig nb2neig neig2nb neig2mat > ### Keywords: utilities > > ### ** Examples > > data(mafragh) > if (require(tripack, quietly=TRUE)) { + par(mfrow = c(2,1)) + provi <- neighbours(tri.mesh(mafragh$xy)) + provi.neig <- neig(list = provi) + + s.label(mafragh$xy, neig = provi.neig, inc = FALSE, + addax = FALSE, clab = 0, cnei = 2) + dist <- apply(provi.neig, 1, function(x) + sqrt(sum((mafragh$xy[x[1],] - mafragh$xy[x[2],])^2))) + #hist(dist, nclass = 50) + mafragh.neig <- neig(edges = provi.neig[dist<50,]) + s.label(mafragh$xy, neig = mafragh.neig, inc = FALSE, + addax = FALSE, clab = 0, cnei = 2) + par(mfrow = c(1,1)) + + data(irishdata) + irish.neig <- neig(area = irishdata$area) + summary(irish.neig) + print(irish.neig) + s.label(irishdata$xy, neig = irish.neig, cneig = 3, + area = irishdata$area, clab = 0.8, inc = FALSE) + + irish.scores <- scores.neig(irish.neig) + par(mfrow = c(2,3)) + for (i in 1:6) s.value(irishdata$xy, irish.scores[,i], + inc = FALSE, grid = FALSE, addax = FALSE, + neig = irish.neig, + csi = 2, cleg = 0, sub = paste("Eigenvector n°",i), csub = 2) + par(mfrow = c(1,1)) + + a.neig <- neig(n.circle = 16) + a.scores <- scores.neig(a.neig) + xy <- cbind.data.frame(cos((1:16) * pi / 8), sin((1:16) * pi / 8)) + par(mfrow = c(4,4)) + for (i in 1:15) s.value(xy, a.scores[,i], neig = a.neig, + csi = 3, cleg = 0) + par(mfrow = c(1,1)) + + a.neig <- neig(n.line = 28) + a.scores <- scores.neig(a.neig) + par(mfrow = c(7,4)) + par(mar = c(1.1,2.1,0.1,0.1)) + for (i in 1:27) barplot(a.scores[,i], col = grey(0.8)) + } Neigbourhood undirected graph Vertices: 25 Degrees: 5 5 4 4 1 5 3 6 5 5 5 4 4 2 3 7 3 7 7 3 8 4 6 4 4 Edges (pairs of vertices): 57 S01 . S02 .. S03 ... S04 .... S05 ..... S06 ..1... S07 ..11... S08 1....... S09 1........ S10 1......11. S11 .1..1...... S12 ..11..1..... S13 .1........1.. S14 .............. S15 .....1......... S16 .1.....1.....1.. S17 .1...........1.1. S18 .....1.1.1.....1.. S19 .....1....1.1.1..1. S20 ..........1...1...1. S21 ..11.1..11.1.....1... S22 ...1....1...........1. S23 .1.....1....1..1.11.... S24 1.......1............1.. S25 1......1.......1.......1. > par(mfrow = c(1,1)) > > if (require(maptools, quiet = TRUE) & require(spdep, quiet = TRUE)) { + data(columbus) + par(mfrow = c(2,1)) + par(mar = c(0.1,0.1,0.1,0.1)) + plot(col.gal.nb, coords) + s.label(data.frame(coords), neig = neig(list = col.gal.nb), + inc = FALSE, clab = 0.6, cneig = 1) + par(mfrow = c(1,1)) + + data(mafragh) + maf.rel <- relativeneigh(as.matrix(mafragh$xy)) + maf.rel <- graph2nb(maf.rel) + s.label(mafragh$xy, neig = neig(list = maf.rel), inc = FALSE, + clab = 0, addax = FALSE, cne = 1, cpo = 2) + + par(mfrow = c(2,2)) + w <- matrix(runif(100), 50, 2) + x.gab <- gabrielneigh(w) + x.gab <- graph2nb(x.gab) + s.label(data.frame(w), neig = neig(list = x.gab), inc = FALSE, + clab = 0, addax = FALSE, cne = 1, cpo = 2, sub = "relative") + x.rel <- relativeneigh(w) + x.rel <- graph2nb(x.rel) + s.label(data.frame(w), neig = neig(list = x.rel), inc = FALSE, + clab = 0, addax = FALSE, cne = 1, cpo = 2, sub = "Gabriel") + k1 <- knn2nb(knearneigh(w)) + s.label(data.frame(w), neig = neig(list = k1), inc = FALSE, + clab = 0, addax = FALSE, cne = 1, cpo = 2, sub = "k nearest neighbours") + + all.linked <- max(unlist(nbdists(k1, w))) + z <- dnearneigh(w, 0, all.linked) + s.label(data.frame(w), neig = neig(list = z), inc = FALSE, + clab = 0, addax = FALSE, cne = 1, cpo = 2, + sub = "Neighbourhood contiguity by distance") + } Loading required package: foreign Loading required package: SparseM > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "newick.eg" > > ### * newick.eg > > flush(stderr()); flush(stdout()) > > ### Name: newick.eg > ### Title: Phylogenetic trees in Newick format > ### Aliases: newick.eg > ### Keywords: datasets > > ### ** Examples > > data(newick.eg) > newick2phylog(newick.eg[[11]]) Phylogenetic tree with 18 leaves and 17 nodes $class: phylog $call: newick2phylog(x.tre = newick.eg[[11]]) $tre: ((Sa,Sh)I1,((((Tl,(Mc,My)...Ls,Lv)I13)I14)I15)I16)Root; class length content $leaves numeric 18 length of the first preceeding adjacent edge $nodes numeric 17 length of the first preceeding adjacent edge $parts list 17 subsets of descendant nodes $paths list 35 path from root to node or leave $droot numeric 35 distance to root class dim content $Wmat matrix 18-18 W matrix : root to the closest ancestor $Wdist dist 153 Nodal distances $Wvalues numeric 17 Eigen values of QWQ/sum(Q) $Wscores data.frame 18-17 Eigen vectors of QWQ '1/n' normed $Amat matrix 18-18 Topological proximity matrix A $Avalues numeric 17 Eigen values of QAQ matrix $Adim integer 1 number of positive eigen values of QAQ $Ascores data.frame 18-17 Eigen vectors of QAQ '1/n' normed $Aparam data.frame 17-3 Topological indices for nodes $Bindica data.frame 18-17 class indicator from nodes $Bscores data.frame 18-17 Topological orthonormal basis '1/n' normed $Blabels character 17 Nodes labelling from orthonormal basis > radial.phylog(newick2phylog(newick.eg[[7]]), circ = 1, + clabel.l = 0.75) > > > > cleanEx(); ..nameEx <- "newick2phylog" > > ### * newick2phylog > > flush(stderr()); flush(stdout()) > > ### Name: newick2phylog > ### Title: Create phylogeny > ### Aliases: newick2phylog hclust2phylog taxo2phylog newick2phylog.addtools > ### Keywords: manip > > ### ** Examples > > > w <- "((((,,),,(,)),),(,));" > w.phy <- newick2phylog(w) > print(w.phy) Phylogenetic tree with 9 leaves and 6 nodes $class: phylog $call: newick2phylog(x.tre = w) $tre: ((((Ext1,Ext2,Ext3)I1,Ext...Ext7)I4,(Ext8,Ext9)I5)Root; class length content $leaves numeric 9 length of the first preceeding adjacent edge $nodes numeric 6 length of the first preceeding adjacent edge $parts list 6 subsets of descendant nodes $paths list 15 path from root to node or leave $droot numeric 15 distance to root class dim content $Wmat matrix 9-9 W matrix : root to the closest ancestor $Wdist dist 36 Nodal distances $Wvalues numeric 8 Eigen values of QWQ/sum(Q) $Wscores data.frame 9-8 Eigen vectors of QWQ '1/n' normed $Amat matrix 9-9 Topological proximity matrix A $Avalues numeric 8 Eigen values of QAQ matrix $Adim integer 1 number of positive eigen values of QAQ $Ascores data.frame 9-8 Eigen vectors of QAQ '1/n' normed $Aparam data.frame 6-3 Topological indices for nodes $Bindica data.frame 9-8 class indicator from nodes $Bscores data.frame 9-8 Topological orthonormal basis '1/n' normed $Blabels character 6 Nodes labelling from orthonormal basis > plot(w.phy) > > ## Not run: > ##D # newick2phylog > ##D data(newick.eg) > ##D radial.phylog(newick2phylog(newick.eg[[8]], FALSE), cnode = 1, > ##D clabel.l = 0.8) > ##D > ##D w <- NULL > ##D w[1] <- "(,((((((((((((((((,,(,(,))),),(((,(,)),(,)),),(,(,)),(,)),(((((" > ##D w[2] <- ",(,)),),),(,)),((((,((,),((,(,)),))),(,)),(,(,),,((,),(,)),)),(" > ##D w[3] <- "(((((,),),(,(,))),),(,)),(((,),),)))),((,,((,),)),(,)),((,),(,)" > ##D w[4] <- ")),(((((((((,,),),,),),((,),)),(,),((,),)),),(((((,),),),((,),)" > ##D w[5] <- "),(((,(,(,(,)))),(,)),(((,),(((((((,),),),,),(,)),(,)),)),((,)" > ##D w[6] <- ",))))),(,((,),(,)),((,(,)),)))),((((,(,(,))),((,(,)),,((,(,)),)" > ##D w[7] <- ",)),(((,),),(((,),),))),((,),))),((((((((((,,,,(,)),),((,),)),(" > ##D w[8] <- ",(,))),(((((((((,(,)),(,)),((((,((,),(,(,(,))))),((,),(,(,))))," > ##D w[9] <- "),((,),))),(((((((((,(,)),((,),(,))),),),),(((,((,),)),),((,((," > ##D w[10] <- "),)),)),(,)),(,(,(,)))),((((,(,)),(,)),(((,),(,)),(,),,(,))),(," > ##D w[11] <- "))),(,,,))),((((,),),),(((,(,(,))),((,),)),(,)))),(,)),),(,((,(" > ##D w[12] <- ",)),),(((,),),))),),(((,),),(,),(,(,))),(((,),(,)),((,),(,))))," > ##D w[13] <- "(((,),((,),)),(((((,,,,,),(,)),(,)),(,((,),))),))),(,(((((,((((" > ##D w[14] <- ",(,)),),),)),),((,((,),((,((,),(,))),))),)),((((,),(((,),(,(,))" > ##D w[15] <- "),)),),)),((,),)))),(((,((,,((,),)),)),),((,),))),((,),(,))),((" > ##D w[16] <- ",),)),(((((,),((,(,)),(((,(,)),(,(((,),),))),))),(,),,),),),,(," > ##D w[17] <- ")),((((,),,),),((,,,),((,),((,),))))),((((((,(,)),,(,)),,(,),(," > ##D w[18] <- "),),(((((,(,(,),)),(((,),,),(,))),),),),,,((,),)),),)),(((((,)," > ##D w[19] <- "(,(,)),),((,((,),),,),)),(((((((,),((((,,,),(,(,))),(((,(,)),)," > ##D w[20] <- "(,))),)),),),),(,)),),),((,),))),((,),)),(((((((((((,),),((((((" > ##D w[21] <- ",),),((,),)),(,)),),)),(,)),),((((((,),),(((,),),)),(,)),),(,))" > ##D w[22] <- ",),),),),(,)),),((,),(,),,,)),(,(,(,)))),),(,)),),);" > ##D phy1 <- newick2phylog(w,FALSE) > ##D phy1 > ##D radial.phylog(phy1, clabel.l = 0, circle = 2.2, clea = 0.5, > ##D cnod = 0.5) > ##D data(newick.eg) > ##D radial.phylog(newick2phylog(newick.eg[[8]], FALSE), cnode = 1, > ##D clabel.l = 0.8) > ##D > ##D # hclust2phylog > ##D data(USArrests) > ##D hc <- hclust(dist(USArrests), "ave") > ##D par(mfrow = c(1,2)) > ##D plot(hc, hang = -1) > ##D phy <- hclust2phylog(hc) > ##D plot.phylog(phy, clabel.l = 0.75, clabel.n = 0.6, f = 0.75) > ##D > ##D par(mfrow = c(1,1)) > ##D row.names(USArrests) > ##D names(phy$leaves) #WARNING not the same for two reasons > ##D row.names(USArrests) <- gsub(" ","_",row.names(USArrests)) > ##D row.names(USArrests) > ##D names(phy$leaves) #WARNING not the same for one reason > ##D USArrests <- USArrests[names(phy$leaves),] > ##D row.names(USArrests) > ##D names(phy$leaves) #the same > ##D table.phylog(data.frame(scalewt(USArrests)), phy, csi = 2.5, > ##D clabel.r = 0.75, f = 0.7) > ##D > ##D #taxo2phylog > ##D data(taxo.eg) > ##D tax <- as.taxo(taxo.eg[[1]]) > ##D tax.phy <- taxo2phylog(as.taxo(taxo.eg[[1]])) > ##D par(mfrow = c(1,2)) > ##D plot.phylog(tax.phy, clabel.l = 1.25, clabel.n = 1.25, f = 0.75) > ##D plot.phylog(taxo2phylog(as.taxo(taxo.eg[[1]][sample(15),])), > ##D clabel.l = 1.25, clabel.n = 1.25, f = 0.75) > ##D > ##D par(mfrow=c(1,1)) > ##D plot.phylog(taxo2phylog(as.taxo(taxo.eg[[2]])), clabel.l = 1, > ##D clabel.n = 0.75, f = 0.65) > ## End(Not run) > > > cleanEx(); ..nameEx <- "niche" > > ### * niche > > flush(stderr()); flush(stdout()) > > ### Name: niche > ### Title: Method to Analyse a pair of tables : Environmental and Faunistic > ### Data > ### Aliases: niche plot.niche print.niche > ### Keywords: multivariate > > ### ** Examples > > data(doubs) > dudi1 <- dudi.pca(doubs$mil, scale = TRUE, scan = FALSE, nf = 3) > nic1 <- niche(dudi1, doubs$poi, scann = FALSE) > > par(mfrow = c(2,2)) > s.traject(dudi1$li, clab = 0) > s.traject(nic1$ls, clab = 0) > s.corcircle(nic1$as) > s.arrow(nic1$c1) > > par(mfrow = c(5,6)) > for (i in 1:27) s.distri(nic1$ls, as.data.frame(doubs$poi[,i]), + csub = 2, sub = names(doubs$poi)[i]) > > par(mfrow = c(1,1)) > s.arrow(nic1$li, clab = 0.7) > > par(mfrow = c(1,1)) > data(trichometeo) > pca1 <- dudi.pca(trichometeo$meteo, scan = FALSE) > nic1 <- niche(pca1, log(trichometeo$fau + 1), scan = FALSE) > plot(nic1) > > data(rpjdl) > plot(niche(dudi.pca(rpjdl$mil, scan = FALSE), rpjdl$fau, scan = FALSE)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "njplot" > > ### * njplot > > flush(stderr()); flush(stdout()) > > ### Name: njplot > ### Title: Phylogeny and trait of bacteria > ### Aliases: njplot > ### Keywords: datasets > > ### ** Examples > > data(njplot) > njplot.phy <- newick2phylog(njplot$tre) > par(mfrow = c(2,1)) > tauxcg0 <- njplot$tauxcg - mean(njplot$tauxcg) > symbols.phylog(njplot.phy, squares = tauxcg0) > symbols.phylog(njplot.phy, circles = tauxcg0) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "olympic" > > ### * olympic > > flush(stderr()); flush(stdout()) > > ### Name: olympic > ### Title: Olympic Decathlon > ### Aliases: olympic > ### Keywords: datasets > > ### ** Examples > > data(olympic) > pca1 <- dudi.pca(olympic$tab, scan = FALSE) > par(mfrow = c(2,2)) > barplot(pca1$eig) > s.corcircle(pca1$co) > plot(olympic$score, pca1$l1[,1]) > abline(lm(pca1$l1[,1]~olympic$score)) > s.label(pca1$l1, clab = 0.5) > s.arrow(2 * pca1$co, add.p = TRUE) > par(mfrow = c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "oribatid" > > ### * oribatid > > flush(stderr()); flush(stdout()) > > ### Name: oribatid > ### Title: Oribatid mite > ### Aliases: oribatid > ### Keywords: datasets > > ### ** Examples > > data(oribatid) > ori.xy <- oribatid$xy[,c(2,1)] > names(ori.xy) <- c("x","y") > plot(ori.xy,pch = 20, cex = 2, asp = 1) > > if (require(tripack, quiet = TRUE)) { + if (require(spdep, quiet = TRUE)) { + plot(voronoi.mosaic(ori.xy), add = TRUE) + s.label(ori.xy, add.p = TRUE, + neig = nb2neig(knn2nb(knearneigh(as.matrix(ori.xy), 3))), + clab = 0) + } + } Loading required package: maptools Loading required package: foreign Loading required package: SparseM > > > > cleanEx(); ..nameEx <- "orthobasis" > > ### * orthobasis > > flush(stderr()); flush(stdout()) > > ### Name: orthobasis > ### Title: Orthonormal basis for orthonormal transform > ### Aliases: orthobasis orthobasis.neig orthobasis.line orthobasis.circ > ### orthobasis.mat orthobasis.listw orthobasis.haar print.orthobasis > ### Keywords: spatial ts > > ### ** Examples > > > # a 2D spatial orthobasis > par(mfrow = c(4,4)) > w <- gridrowcol(8,8) > for (k in 1:16) + s.value(w$xy, w$orthobasis[,k], cleg = 0, csi = 2, incl = FALSE, + addax = FALSE, sub = k, csub = 4, ylim = c(0,10), cgri = 0) > par(mfrow = c(1,1)) > barplot(attr(w$orthobasis, "values")) > > # Haar 1D orthobasis > w <- orthobasis.haar(32) > par(mfrow = c(8,4)) > par(mar = c(0.1,0.1,0.1,0.1)) > for (k in 1:31) { + plot(w[,k], type="S",xlab = "", ylab = "", xaxt = "n", + yaxt = "n", xaxs = "i", yaxs = "i",ylim=c(-4.5,4.5)) + points(w[,k], type = "p", pch = 20, cex = 1.5) + } > > # a 1D orthobasis > w <- orthobasis.line(n = 33) > par(mfrow = c(8,4)) > par(mar = c(0.1,0.1,0.1,0.1)) > for (k in 1:32) { + plot(w[,k], type="l",xlab = "", ylab = "", xaxt = "n", + yaxt = "n", xaxs = "i", yaxs = "i",ylim=c(-1.5,1.5)) + points(w[,k], type = "p", pch = 20, cex = 1.5) + } > > par(mfrow = c(1,1)) > barplot(attr(w, "values")) > > w <- orthobasis.circ(n = 26) > #par(mfrow = c(5,5)) > #par(mar = c(0.1,0.1,0.1,0.1)) > # for (k in 1:25) > # dotcircle(w[,k], xlim = c(-1.5,1.5), cleg = 0) > > par(mfrow = c(1,1)) > #barplot(attr(w, "values")) > > ## Not run: > ##D # a spatial orthobasis > ##D data(mafragh) > ##D w <- orthobasis.neig(mafragh$neig) > ##D par(mfrow = c(4,2)) > ##D for (k in 1:8) > ##D s.value(mafragh$xy, w[,k],cleg = 0, sub = as.character(k), > ##D csub = 3) > ##D > ##D par(mfrow = c(1,1)) > ##D barplot(attr(w, "values")) > ##D > ##D # a phylogenetic orthobasis > ##D data(njplot) > ##D phy <- newick2phylog(njplot$tre) > ##D wA <- phy$Ascores > ##D wW <- phy$Wscores > ##D table.phylog(phylog = phy, wA, clabel.row = 0, clabel.col = 0.5) > ##D table.phylog(phylog = phy, wW, clabel.row = 0, clabel.col = 0.5) > ##D > ## End(Not run) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "orthogram" > > ### * orthogram > > flush(stderr()); flush(stdout()) > > ### Name: orthogram > ### Title: Orthonormal decomposition of variance > ### Aliases: orthogram > ### Keywords: spatial ts > > ### ** Examples > > # a phylogenetic example > data(ungulates) > ung.phy <- newick2phylog(ungulates$tre) > FemBodyMass <- log(ungulates$tab[,1]) > NeonatBodyMass <- log((ungulates$tab[,2]+ungulates$tab[,3])/2) > plot(FemBodyMass,NeonatBodyMass, pch = 20, cex = 2) > abline(lm(NeonatBodyMass~FemBodyMass)) > z <- residuals(lm(NeonatBodyMass~FemBodyMass)) > dotchart.phylog(ung.phy,val = z, clabel.n = 1, + labels.n = ung.phy$Blabels, cle = 1.5, cdot = 2) > table.phylog(ung.phy$Bscores, ung.phy,clabel.n = 1, + labels.n = ung.phy$Blabels) > orthogram(z, ung.phy$Bscores) class: krandtest test number: 4 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 R2Max 0.357 0.734 0.268 2 SkR2k 5.32 0.012 0.99 3 Dmax 0.427 0.985 0.017 4 SCE 1.047 0.972 0.03 > orthogram(z, phyl=ung.phy) # the same thing class: krandtest test number: 4 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 R2Max 0.357 0.734 0.268 2 SkR2k 5.32 0.012 0.99 3 Dmax 0.427 0.985 0.017 4 SCE 1.047 0.972 0.03 > > # a spatial example > data(irishdata) > neig1 <- neig(mat01 = 1*(irishdata$link > 0)) > sco1 <- scores.neig(neig1) > z <- scalewt(irishdata$tab$cow) > orthogram(z, sco1) class: krandtest test number: 4 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 R2Max 0.322 0.911 0.091 2 SkR2k 4.055 0.001 1 3 Dmax 0.629 1 0.001 4 SCE 3.834 1 0.001 > > # a temporal example > data(arrival) > w <- orthobasis.circ(24) > orthogram(arrival$hours, w) class: krandtest test number: 4 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 R2Max 0.738 1 0.001 2 SkR2k 4.426 0.001 1 3 Dmax 0.651 1 0.001 4 SCE 3.53 1 0.001 > par(mfrow = c(1,2)) > dotcircle(arrival$hours) > dotcircle(w[,2]) > par(mfrow = c(1,1)) > > data(lynx) > ortho <- orthobasis.line(114) > orthogram(lynx,ortho) class: krandtest test number: 4 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 R2Max 0.328 1 0.001 2 SkR2k 25.524 0.001 1 3 Dmax 0.58 1 0.001 4 SCE 13.274 1 0.001 > attributes(lynx)$tsp [1] 1821 1934 1 > par(mfrow = c(2,1)) > par(mar = c(4,4,2,2)) > plot.ts(lynx) > plot(ts(ortho[,23], start = 1821, end = 1934, freq = 1), ylab = "score 23") > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "ours" > > ### * ours > > flush(stderr()); flush(stdout()) > > ### Name: ours > ### Title: A table of Qualitative Variables > ### Aliases: ours > ### Keywords: datasets > > ### ** Examples > > data(ours) > boxplot(dudi.acm(ours, scan = FALSE)) > > > > cleanEx(); ..nameEx <- "palm" > > ### * palm > > flush(stderr()); flush(stdout()) > > ### Name: palm > ### Title: Phylogenetic and quantitative traits of amazonian palm trees > ### Aliases: palm > ### Keywords: datasets > > ### ** Examples > > ## Not run: > ##D data(palm) > ##D palm.phy <- newick2phylog(palm$tre) > ##D radial.phylog(palm.phy,clabel.l=1.25) > ##D > ##D orthogram(palm$traits[,4],palm.phy$Bscores) > ##D dotchart.phylog(palm.phy,palm$traits[,4], clabel.l = 1, > ##D labels.n = palm.phy$Blabels, clabel.n = 0.75) > ##D w <- cbind.data.frame(palm.phy$Bscores[,c(3,4,6,13,21)], > ##D scalewt((palm$traits[,4]))) > ##D names(w)[6] <- names(palm$traits[4]) > ##D table.phylog(w, palm.phy, clabel.r = 0.75, f = 0.5) > ##D > ##D gearymoran(palm.phy$Amat, palm$traits[,-c(1,3)]) > ## End(Not run) > > > cleanEx(); ..nameEx <- "pap" > > ### * pap > > flush(stderr()); flush(stdout()) > > ### Name: pap > ### Title: Taxonomy and quantitative traits of carnivora > ### Aliases: pap > ### Keywords: datasets > > ### ** Examples > > data(pap) > taxo <- taxo2phylog(as.taxo(pap$taxo)) > table.phylog(as.data.frame(scalewt(pap$tab)), taxo, csi = 2, clabel.nod = 0.6, + f.phylog = 0.6) > > > > cleanEx(); ..nameEx <- "pcaiv" > > ### * pcaiv > > flush(stderr()); flush(stdout()) > > ### Name: pcaiv > ### Title: Principal component analysis with respect to instrumental > ### variables > ### Aliases: pcaiv plot.pcaiv print.pcaiv > ### Keywords: multivariate > > ### ** Examples > > data(rhone) > pca1 <- dudi.pca(rhone$tab, scan = FALSE, nf = 3) > iv1 <- pcaiv(pca1, rhone$disch, scan = FALSE) > iv1 Principal Component Analysis with Instrumental Variables call: pcaiv(dudi = pca1, df = rhone$disch, scannf = FALSE) class: pcaiv dudi $rank (rank) : 3 $nf (axis saved) : 2 eigen values: 3.703 3.538 0.3015 vector length mode content $eig 3 numeric eigen values $lw 39 numeric row weigths (from dudi) $cw 15 numeric col weigths (from dudi) data.frame nrow ncol content $Y 39 15 Dependant variables $X 39 3 Explanatory variables $tab 39 15 modified array (projected variables) data.frame nrow ncol content $c1 15 2 PPA Pseudo Principal Axes $as 3 2 Principal axis of dudi$tab on PAP $ls 39 2 projection of lines of dudi$tab on PPA $li 39 2 $ls predicted by X data.frame nrow ncol content $fa 4 2 Loadings (CPC as linear combinations of X $l1 39 2 CPC Constraint Principal Components $co 15 2 inner product CPC - Y $cor 4 2 correlation CPC - X iner inercum inerC inercumC ratio R2 lambda 6.27 6.27 5.52 5.52 0.879 0.671 3.7 4.14 10.4 4.74 10.3 0.984 0.747 3.54 > # iner inercum inerC inercumC ratio R2 lambda > # 6.27 6.27 5.52 5.52 0.879 0.671 3.7 > # 4.14 10.4 4.74 10.3 0.984 0.747 3.54 > plot(iv1) > > > > cleanEx(); ..nameEx <- "pcaivortho" > > ### * pcaivortho > > flush(stderr()); flush(stdout()) > > ### Name: pcaivortho > ### Title: Principal Component Analysis with respect to orthogonal > ### instrumental variables > ### Aliases: pcaivortho > ### Keywords: multivariate > > ### ** Examples > > ## Not run: > ##D par(mfrow = c(2,2)) > ##D data(avimedi) > ##D cla <- avimedi$plan$reg:avimedi$plan$str > ##D > ##D # simple ordination > ##D coa1 <- dudi.coa(avimedi$fau, scan = FALSE, nf = 3) > ##D s.class(coa1$li, cla, sub = "Sans contrainte") > ##D > ##D # within region > ##D w1 <- within(coa1, avimedi$plan$reg, scan = FALSE) > ##D s.match(w1$li, w1$ls, clab = 0, sub = "Intra Région") > ##D s.class(w1$li, cla, add.plot = TRUE) > ##D > ##D # no region the same result > ##D pcaivnonA <- pcaivortho(coa1, avimedi$plan$reg, scan = FALSE) > ##D s.match(pcaivnonA$li, pcaivnonA$ls, clab = 0, > ##D sub = "Contrainte Non A") > ##D s.class(pcaivnonA$li, cla, add.plot = TRUE) > ##D > ##D # region + strate > ##D interAplusB <- pcaiv(coa1, avimedi$plan, scan = FALSE) > ##D s.match(interAplusB$li, interAplusB$ls, clab = 0, > ##D sub = "Contrainte A + B") > ##D s.class(interAplusB$li, cla, add.plot = TRUE) > ##D > ##D par(mfrow = c(1,1)) > ## End(Not run) > > > cleanEx(); ..nameEx <- "pcoscaled" > > ### * pcoscaled > > flush(stderr()); flush(stdout()) > > ### Name: pcoscaled > ### Title: Simplified Analysis in Principal Coordinates > ### Aliases: pcoscaled > ### Keywords: array > > ### ** Examples > > a <- 1 / sqrt(3) - 0.2 > w <- matrix(c(0,0.8,0.8,a,0.8,0,0.8,a, + 0.8,0.8,,0,a,a,a,a,0),4,4) > w <- as.dist(w) > w <- cailliez(w) > w 1 2 3 2 1.0000000 3 1.0000000 1.0000000 4 0.5773503 0.5773503 0.5773503 > pcoscaled(w) C1 C2 1 1.1547005 0 2 -0.5773503 -1 3 -0.5773503 1 4 0.0000000 0 > dist(pcoscaled(w)) # w 1 2 3 2 2.000000 3 2.000000 2.000000 4 1.154701 1.154701 1.154701 > dist(pcoscaled(2 * w)) # the same 1 2 3 2 2.000000 3 2.000000 2.000000 4 1.154701 1.154701 1.154701 > sum(pcoscaled(w)^2) # unity [1] 4 > > > > cleanEx(); ..nameEx <- "perthi02" > > ### * perthi02 > > flush(stderr()); flush(stdout()) > > ### Name: perthi02 > ### Title: Contingency Table with a partition in Molecular Biology > ### Aliases: perthi02 > ### Keywords: datasets > > ### ** Examples > > data(perthi02) > plot(discrimin.coa(perthi02$tab, perthi02$cla, scan = FALSE)) > > > > cleanEx(); ..nameEx <- "phylog" > > ### * phylog > > flush(stderr()); flush(stdout()) > > ### Name: phylog > ### Title: Phylogeny > ### Aliases: phylog print.phylog phylog.extract phylog.permut > ### Keywords: manip > > ### ** Examples > > marthans.tre <- NULL > marthans.tre[1] <-"((((1:4,2:4)a:5,(3:7,4:7)b:2)c:2,5:11)d:2," > marthans.tre[2] <- "((6:5,7:5)e:4,(8:4,9:4)f:5)g:4);" > marthans.phylog <- newick2phylog(marthans.tre) > marthans.phylog Phylogenetic tree with 9 leaves and 8 nodes $class: phylog $call: newick2phylog(x.tre = marthans.tre) $tre: ((((X1,X2)a,(X3,X4)b)c,X5...,((X6,X7)e,(X8,X9)f)g)Root; class length content $leaves numeric 9 length of the first preceeding adjacent edge $nodes numeric 8 length of the first preceeding adjacent edge $parts list 8 subsets of descendant nodes $paths list 17 path from root to node or leave $droot numeric 17 distance to root class dim content $Wmat matrix 9-9 W matrix : root to the closest ancestor $Wdist dist 36 Nodal distances $Wvalues numeric 8 Eigen values of QWQ/sum(Q) $Wscores data.frame 9-8 Eigen vectors of QWQ '1/n' normed $Amat matrix 9-9 Topological proximity matrix A $Avalues numeric 8 Eigen values of QAQ matrix $Adim integer 1 number of positive eigen values of QAQ $Ascores data.frame 9-8 Eigen vectors of QAQ '1/n' normed $Aparam data.frame 8-3 Topological indices for nodes $Bindica data.frame 9-8 class indicator from nodes $Bscores data.frame 9-8 Topological orthonormal basis '1/n' normed $Blabels character 8 Nodes labelling from orthonormal basis > > if (require(ape, quietly=TRUE)) { + marthans.phylo <- read.tree(text = marthans.tre) + marthans.phylo + + par(mfrow =c (1,2)) + plot.phylog(marthans.phylog, cnode = 3, f = 0.8, cle = 3) + plot.phylo(marthans.phylo) + par(mfrow = c(1,1)) + } Loading required package: gee Loading required package: nlme Loading required package: lattice > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "plot.phylog" > > ### * plot.phylog > > flush(stderr()); flush(stdout()) > > ### Name: plot.phylog > ### Title: Plot phylogenies > ### Aliases: plot.phylog radial.phylog enum.phylog > ### Keywords: hplot > > ### ** Examples > > data(newick.eg) > par(mfrow = c(3,2)) > for(i in 1:6) plot.phylog(newick2phylog(newick.eg[[i]], FALSE), + clea = 2, clabel.l = 3, cnod = 2.5) > par(mfrow = c(1,1)) > > ## Not run: > ##D par(mfrow = c(1,2)) > ##D plot.phylog(newick2phylog(newick.eg[[11]], FALSE), clea = 1.5, > ##D clabel.l = 1.5, clabel.nod = 0.75, f = 0.8) > ##D plot.phylog(newick2phylog(newick.eg[[10]], FALSE), clabel.l = 0, > ##D clea = 0, cn = 0, f = 1) > ##D par(mfrow = c(1,1)) > ## End(Not run) > > par(mfrow = c(2,2)) > w7 <- newick2phylog("(((((1,2,3)b),(6)c),(4,5)d,7)f);") > plot.phylog(w7,clabel.l = 1.5, clabel.n = 1.5, f = 0.8, cle = 2, + cnod = 3, sub = "(((((1,2,3)b),(6)c),(4,5)d,7)f);", csub = 2) > w <- NULL > w[1] <- "((((e1:4,e2:4)a:5,(e3:7,e4:7)b:2)c:2,e5:11)d:2," > w[2] <- "((e6:5,e7:5)e:4,(e8:4,e9:4)f:5)g:4);" > plot(newick2phylog(w), f = 0.8, cnod = 2, cleav = 2, clabel.l = 2) > > data(taxo.eg) > w <- taxo2phylog(as.taxo(taxo.eg[[1]])) > plot(w, clabel.lea = 1.25, clabel.n = 1.25, sub = "Taxonomy", + csub = 3, f = 0.8, possub = "topleft") > > provi.tre <- "(((a,b,c,d,e)A,(f,g,h)B)C)D;" > provi.phy <- newick2phylog(provi.tre) > plot.phylog(provi.phy, clabel.l = 2, clabel.n = 2, f = 0.8) > par(mfrow = c(1,1)) > > ## Not run: > ##D par(mfrow = c(3,3)) > ##D for (j in 1:6) radial.phylog(newick2phylog(newick.eg[[j]], > ##D FALSE), clabel.l = 2, cnodes = 2) > ##D radial.phylog(newick2phylog(newick.eg[[7]],FALSE), clabel.l = 2) > ##D radial.phylog(newick2phylog(newick.eg[[8]],FALSE), clabel.l = 0, > ##D circle = 1.8) > ##D radial.phylog(newick2phylog(newick.eg[[9]],FALSE), clabel.l = 1, > ##D clabel.n = 1, cle = 0, cnode = 1) > ##D par(mfrow = c(1,1)) > ##D > ##D data(bsetal97) > ##D bsetal.phy = taxo2phylog(as.taxo(bsetal97$taxo[,1:3]), FALSE) > ##D radial.phylog(bsetal.phy, cnod = 1, clea = 1, clabel.l = 0.75, > ##D draw.box = TRUE, cir = 1.1) > ##D par(mfrow = c(1,1)) > ## End(Not run) > > ## Not run: > ##D # plot all the possible representations of a phylogenetic tree > ##D a <- "((a,b)A,(c,d,(e,f)B)C)D;" > ##D wa <- newick2phylog(a) > ##D wx <- enum.phylog(wa) > ##D dim(wx) > ##D > ##D par(mfrow = c(6,8)) > ##D fun <- function(x) { > ##D w <-NULL > ##D lapply(x, function(y) w<<-paste(w,as.character(y),sep="")) > ##D plot(wa, x, clabel.n = 1.25, f = 0.75, clabel.l = 2, > ##D box = FALSE, cle = 1.5, sub = w, csub = 2) > ##D invisible()} > ##D apply(wx,1,fun) > ##D par(mfrow = c(1,1)) > ## End(Not run) > > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "presid2002" > > ### * presid2002 > > flush(stderr()); flush(stdout()) > > ### Name: presid2002 > ### Title: Results of the French presidential elections of 2002 > ### Aliases: presid2002 > ### Keywords: datasets > > ### ** Examples > > data(presid2002) > all((presid2002$tour2$Chirac + presid2002$tour2$Le_Pen) == presid2002$tour2$exprimes) [1] TRUE > ## Not run: > ##D data(elec88) > ##D data(cnc2003) > ##D w1 = area.util.class(elec88$area, cnc2003$reg) > ##D > ##D par(mfrow = c(2,2)) > ##D par(mar = c(0.1,0.1,0.1,0.1)) > ##D > ##D area.plot(w1) > ##D w = scale(elec88$tab$Chirac) > ##D s.value(elec88$xy, w, add.plot = TRUE) > ##D scatterutil.sub("Chirac 1988 T1", csub = 2, "topleft") > ##D > ##D area.plot(w1) > ##D w = scale(presid2002$tour1$Chirac/ presid2002$tour1$exprimes) > ##D s.value(elec88$xy, w, add.plot = TRUE) > ##D scatterutil.sub("Chirac 2002 T1", csub = 2, "topleft") > ##D > ##D area.plot(w1) > ##D w = scale(elec88$tab$Mitterand) > ##D s.value(elec88$xy, w, add.plot = TRUE) > ##D scatterutil.sub("Mitterand 1988 T1", csub = 2, "topleft") > ##D > ##D area.plot(w1) > ##D w = scale(presid2002$tour2$Chirac/ presid2002$tour2$exprimes) > ##D s.value(elec88$xy, w, add.plot = TRUE) > ##D scatterutil.sub("Chirac 2002 T2", csub = 2, "topleft") > ## End(Not run) > > > > cleanEx(); ..nameEx <- "procella" > > ### * procella > > flush(stderr()); flush(stdout()) > > ### Name: procella > ### Title: Phylogeny and quantitative traits of birds > ### Aliases: procella > ### Keywords: datasets > > ### ** Examples > > data(procella) > pro.phy <- newick2phylog(procella$tre) > plot(pro.phy,clabel.n = 1, clabel.l = 1) > wt <- procella$traits > wt$site.fid[is.na(wt$site.fid)] <- mean(wt$site.fid[!is.na(wt$site.fid)]) > wt$site.fid <- asin(sqrt(wt$site.fid/100)) > wt$ALE[is.na(wt$ALE)] <- mean(wt$ALE[!is.na(wt$ALE)]) > wt$ALE <- sqrt(wt$ALE) > wt$BF[is.na(wt$BF)] <- mean(wt$BF[!is.na(wt$BF)]) > wt$mass <- log(wt$mass) > wt <- wt[, -6] > table.phylog(scalewt(wt), pro.phy, csi = 2) > gearymoran(pro.phy$Amat,wt,9999) class: krandtest test number: 5 permutation number: 9999 test obs P(X<=obs) P(X>=obs) 1 site.fid 0.0999 0.7687 0.2315 2 mate.fid 0.1776 0.8864 0.1138 3 mass 0.5447 0.9994 8e-04 4 ALE 9e-04 0.5342 0.466 5 BF 0.1972 0.9076 0.0926 > > > > cleanEx(); ..nameEx <- "procuste" > > ### * procuste > > flush(stderr()); flush(stdout()) > > ### Name: procuste > ### Title: Simple Procruste Rotation between two sets of points > ### Aliases: procuste plot.procuste print.procuste > ### Keywords: multivariate > > ### ** Examples > > data(macaca) > par(mfrow = c(2,2)) > pro1 <- procuste(macaca$xy1, macaca$xy2, scal = FALSE) > s.match(pro1$tab1, pro1$rot2, clab = 0.7) > s.match(pro1$tab2, pro1$rot1, clab = 0.7) > pro2 <- procuste(macaca$xy1, macaca$xy2) > s.match(pro2$tab1, pro2$rot2, clab = 0.7) > s.match(pro2$tab2, pro2$rot1, clab = 0.7) > par(mfrow = c(1,1)) > > data(doubs) > pca1 <- dudi.pca(doubs$mil, scal = TRUE, scann = FALSE) > pca2 <- dudi.pca(doubs$poi, scal = FALSE, scann = FALSE) > pro3 <- procuste(pca1$tab, pca2$tab, nf = 2) > par(mfrow = c(2,2)) > s.traject(pro3$scor1, clab = 0) > s.label(pro3$scor1, clab = 0.8, add.p = TRUE) > s.traject(pro3$scor2, clab = 0) > s.label(pro3$scor2, clab = 0.8, add.p = TRUE) > s.arrow(pro3$load1, clab = 0.75) > s.arrow(pro3$load2, clab = 0.75) > plot(pro3) > par(mfrow = c(1,1)) > > data(fruits) > plot(procuste(scalewt(fruits$jug), scalewt(fruits$var))) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "procuste.randtest" > > ### * procuste.randtest > > flush(stderr()); flush(stdout()) > > ### Name: procuste.randtest > ### Title: Monte-Carlo Test on the sum of the singular values of a > ### procustean rotation (in C). > ### Aliases: procuste.randtest > ### Keywords: multivariate nonparametric > > ### ** Examples > > data(doubs) > pca1 <- dudi.pca(doubs$mil, scal = TRUE, scann = FALSE) > pca2 <- dudi.pca(doubs$poi, scal = FALSE, scann = FALSE) > protest1 <- procuste.randtest(pca1$tab, pca2$tab, 999) > protest1 Monte-Carlo test Observation: 0.6562 Call: procuste.randtest(df1 = pca1$tab, df2 = pca2$tab, nrepet = 999) Based on 999 replicates Simulated p-value: 0.001 > plot(protest1,main="PROTEST") > > > > cleanEx(); ..nameEx <- "procuste.rtest" > > ### * procuste.rtest > > flush(stderr()); flush(stdout()) > > ### Name: procuste.rtest > ### Title: Monte-Carlo Test on the sum of the singular values of a > ### procustean rotation (in R). > ### Aliases: procuste.rtest > ### Keywords: multivariate nonparametric > > ### ** Examples > > data(doubs) > pca1 <- dudi.pca(doubs$mil, scal = TRUE, scann = FALSE) > pca2 <- dudi.pca(doubs$poi, scal = FALSE, scann = FALSE) > proc1 <- procuste(pca1$tab, pca2$tab) > protest1 <- procuste.rtest(pca1$tab, pca2$tab, 999) > protest1 Monte-Carlo test Observation: 0.6562 Call: procuste.rtest(df1 = pca1$tab, df2 = pca2$tab, nrepet = 999) Based on 999 replicates Simulated p-value: 0.001 > plot(protest1) > > > > cleanEx(); ..nameEx <- "pta" > > ### * pta > > flush(stderr()); flush(stdout()) > > ### Name: pta > ### Title: Partial Triadic Analysis of a K-tables > ### Aliases: pta print.pta plot.pta > ### Keywords: multivariate > > ### ** Examples > > data(meaudret) > wit1 <- within.pca(meaudret$mil, meaudret$plan$dat, scan = FALSE, + scal = "partial") > kta1 <- ktab.within(wit1, colnames = rep(c("S1","S2","S3","S4","S5"), 4)) > kta2 <- t(kta1) > pta1 <- pta(kta2, scann = FALSE) > pta1 Partial Triadic Analysis class:pta dudi table number: 4 row number: 5 column number: 9 **** Interstructure **** eigen values: 2.812 0.7541 0.2537 0.18 $RV matrix 4 4 RV coefficients $RV.eig vector 4 eigenvalues $RV.coo data.frame 4 4 array scores $tab.names vector 4 array names **** Compromise **** eigen values: 17.2 7.298 0.6099 0.2008 $nf: 2 axis-components saved $rank: 4 vector length mode content $tabw 4 numeric array weights $cw 9 numeric column weights $lw 5 numeric row weights $eig 4 numeric eigen values $cos2 4 numeric cosine^2 between compromise and arrays data.frame nrow ncol content $tab 5 9 modified array $li 5 2 row coordinates $l1 5 2 row normed scores $co 9 2 column coordinates $c1 9 2 column normed scores **** Intrastructure **** data.frame nrow ncol content $Tli 20 2 row coordinates (each table) $Tco 36 2 col coordinates (each table) $Tcomp 16 2 principal components (each table) $Tax 16 2 principal axis (each table) $TL 20 2 factors for Tli $TC 36 2 factors for Tco $T4 16 2 factors for Tax Tcomp > plot(pta1) > > > > cleanEx(); ..nameEx <- "quasieuclid" > > ### * quasieuclid > > flush(stderr()); flush(stdout()) > > ### Name: quasieuclid > ### Title: Transformation of a distance matrice to a Euclidean one > ### Aliases: quasieuclid > ### Keywords: array > > ### ** Examples > > data(yanomama) > geo <- as.dist(yanomama$geo) > is.euclid(geo) # FALSE [1] FALSE > geo1 <- quasieuclid(geo) > is.euclid(geo1) # TRUE [1] TRUE > par(mfrow = c(2,2)) > lapply(yanomama, function(x) plot(as.dist(x), quasieuclid(as.dist(x)))) $geo NULL $gen NULL $ant NULL > > par(mfrow = c(1,1)) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "randtest" > > ### * randtest > > flush(stderr()); flush(stdout()) > > ### Name: randtest > ### Title: Class of the Permutation Tests (in C). > ### Aliases: randtest as.randtest plot.randtest print.randtest > ### Keywords: methods > > ### ** Examples > > par(mfrow = c(2,2)) > for (x0 in c(2.4,3.4,5.4,20.4)) { + l0 <- as.randtest(sim = rnorm(200), obs = x0) + print(l0) + plot(l0,main=paste("p.value = ", round(l0$pvalue, dig = 5))) + } Monte-Carlo test Observation: 2.4 Call: as.randtest(sim = rnorm(200), obs = x0) Based on 200 replicates Simulated p-value: 0.009950249 Monte-Carlo test Observation: 3.4 Call: as.randtest(sim = rnorm(200), obs = x0) Based on 200 replicates Simulated p-value: 0.004975124 Monte-Carlo test Observation: 5.4 Call: as.randtest(sim = rnorm(200), obs = x0) Based on 200 replicates Simulated p-value: 0.004975124 Monte-Carlo test Observation: 20.4 Call: as.randtest(sim = rnorm(200), obs = x0) Based on 200 replicates Simulated p-value: 0.004975124 > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "randtest.amova" > > ### * randtest.amova > > flush(stderr()); flush(stdout()) > > ### Name: randtest.amova > ### Title: Permutation tests on an analysis of molecular variance (in C). > ### Aliases: randtest.amova > ### Keywords: multivariate nonparametric > > ### ** Examples > > data(humDNAm) > amovahum <- amova(humDNAm$samples, sqrt(humDNAm$distances), humDNAm$structures) > amovahum $call amova(samples = humDNAm$samples, distances = sqrt(humDNAm$distances), structures = humDNAm$structures) $results Df Sum Sq Mean Sq Between regions 4 78.238115 19.5595288 Between samples Within regions 5 9.284744 1.8569488 Within samples 662 316.197379 0.4776395 Total 671 403.720238 0.6016695 $componentsofcovariance Sigma % Variations Between regions 0.13380659 21.119144 Variations Between samples Within regions 0.02213345 3.493396 Variations Within samples 0.47763955 75.387459 Total variations 0.63357958 100.000000 $statphi Phi Phi-samples-total 0.2461254 Phi-samples-regions 0.0442870 Phi-regions-total 0.2111914 > randtesthum <- randtest.amova(amovahum, 49) > plot(randtesthum) > > > > cleanEx(); ..nameEx <- "randtest.between" > > ### * randtest.between > > flush(stderr()); flush(stdout()) > > ### Name: randtest.between > ### Title: Monte-Carlo Test on the between-groups inertia percentage (in > ### C). > ### Aliases: randtest.between > ### Keywords: multivariate nonparametric > > ### ** Examples > > data(meaudret) > pca1 <- dudi.pca(meaudret$mil, scan = FALSE, nf = 3) > rand1 <- randtest(between(pca1, meaudret$plan$dat, scan = FALSE), 99) > rand1 Monte-Carlo test Observation: 0.3722686 Call: randtest.between(xtest = between(pca1, meaudret$plan$dat, scan = FALSE), nrepet = 99) Based on 99 replicates Simulated p-value: 0.01 > plot(rand1, main = "Monte-Carlo test") > > > > cleanEx(); ..nameEx <- "randtest.coinertia" > > ### * randtest.coinertia > > flush(stderr()); flush(stdout()) > > ### Name: randtest.coinertia > ### Title: Monte-Carlo test on a coinertia analysis (in C). > ### Aliases: randtest.coinertia > ### Keywords: multivariate nonparametric > > ### ** Examples > > data(doubs) > dudi1 <- dudi.pca(doubs$mil, scale = TRUE, scan = FALSE, nf = 3) > dudi2 <- dudi.pca(doubs$poi, scale = FALSE, scan = FALSE, nf = 2) > coin1 <- coinertia(dudi1,dudi2, scan = FALSE, nf = 2) > plot(randtest(coin1)) > > > > cleanEx(); ..nameEx <- "randtest.discrimin" > > ### * randtest.discrimin > > flush(stderr()); flush(stdout()) > > ### Name: randtest.discrimin > ### Title: Monte-Carlo Test on a Discriminant Analysis (in C). > ### Aliases: randtest.discrimin > ### Keywords: multivariate nonparametric > > ### ** Examples > > data(meaudret) > pca1 <- dudi.pca(meaudret$mil, scan = FALSE, nf = 3) > rand1 <- randtest(discrimin(pca1, meaudret$plan$dat, scan = FALSE), 99) > rand1 Monte-Carlo test Observation: 0.3034897 Call: randtest.discrimin(xtest = discrimin(pca1, meaudret$plan$dat, scan = FALSE), nrepet = 99) Based on 99 replicates Simulated p-value: 0.01 > #Monte-Carlo test > #Observation: 0.3035 > #Call: as.randtest(sim = sim, obs = obs) > #Based on 999 replicates > #Simulated p-value: 0.001 > plot(rand1, main = "Monte-Carlo test") > summary.manova(manova(as.matrix(meaudret$mil)~meaudret$plan$dat), "Pillai") Df Pillai approx F num Df den Df Pr(>F) meaudret$plan$dat 3 2.7314 11.2993 27 30 1.636e-09 *** Residuals 16 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > # Df Pillai approx F num Df den Df Pr(>F) > # meaudret$plan$dat 3 2.73 11.30 27 30 1.6e-09 *** > # Residuals 16 > # --- > # Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 > # 2.731/9 = 0.3034 > > > > cleanEx(); ..nameEx <- "rankrock" > > ### * rankrock > > flush(stderr()); flush(stdout()) > > ### Name: rankrock > ### Title: Ordination Table > ### Aliases: rankrock > ### Keywords: datasets > > ### ** Examples > > data(rankrock) > dudi1 <- dudi.pca(rankrock, scannf = FALSE, nf = 3) > scatter(dudi1, clab.r = 1.5) > > > > cleanEx(); ..nameEx <- "reconst" > > ### * reconst > > flush(stderr()); flush(stdout()) > > ### Name: reconst > ### Title: Reconstitution of Data from a Duality Diagram > ### Aliases: reconst reconst.pca > ### Keywords: multivariate > > ### ** Examples > > data(rhone) > dd1 <- dudi.pca(rhone$tab, nf = 2, scann = FALSE) > rh1 <- reconst(dd1, 1) > rh2 <- reconst(dd1, 2) > par(mfrow = c(4,4)) > par(mar = c(2.6,2.6,1.1,1.1)) > for (i in 1:15) { + plot(rhone$date, rhone$tab[,i]) + lines(rhone$date, rh1[,i], lty = 2) + lines(rhone$date, rh2[,i], lty = 1) + scatterutil.sub(names(rhone$tab)[i], 2, "topright") + } > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "rhone" > > ### * rhone > > flush(stderr()); flush(stdout()) > > ### Name: rhone > ### Title: Physico-Chemistry Data > ### Aliases: rhone > ### Keywords: datasets > > ### ** Examples > > data(rhone) > pca1 <- dudi.pca(rhone$tab, nf = 2, scann = FALSE) > rh1 <- reconst(pca1, 1) > rh2 <- reconst(pca1, 2) > par(mfrow = c(4,4)) > par(mar = c(2.6,2.6,1.1,1.1)) > for (i in 1:15) { + plot(rhone$date, rhone$tab[,i]) + lines(rhone$date, rh1[,i], lwd = 2) + lines(rhone$date, rh2[,i]) + scatterutil.sub(names(rhone$tab)[i], 2, "topright") + } > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "rlq" > > ### * rlq > > flush(stderr()); flush(stdout()) > > ### Name: rlq > ### Title: RLQ analysis > ### Aliases: rlq print.rlq plot.rlq summary.rlq as.coinertia randtest.rlq > ### Keywords: multivariate spatial > > ### ** Examples > > data(aviurba) > coa1 <- dudi.coa(aviurba$fau, scannf = FALSE, nf = 2) > dudimil <- dudi.hillsmith(aviurba$mil, scannf = FALSE, nf = 2, row.w = coa1$lw) > duditrait <- dudi.hillsmith(aviurba$traits, scannf = FALSE, nf = 2, row.w = coa1$cw) > rlq1 <- rlq(dudimil, coa1, duditrait, scannf = FALSE, nf = 2) > plot(rlq1) > summary(rlq1) Eigenvalues decomposition: eig covar sdR sdQ corr 1 0.4782826 0.6915798 1.558312 1.158357 0.3831293 2 0.1418508 0.3766308 1.308050 1.219367 0.2361331 Inertia & coinertia R: inertia max ratio 1 2.428337 2.996911 0.8102800 12 4.139332 5.345110 0.7744148 Inertia & coinertia Q: inertia max ratio 1 1.341791 2.603139 0.5154512 12 2.828648 4.202981 0.6730098 Correlation L: corr max ratio 1 0.3831293 0.6435487 0.5953384 2 0.2361331 0.5220054 0.4523576 RV: 0.0394881 > randtest.rlq(rlq1) Monte-Carlo test Observation: 0.7278339 Call: randtest.rlq(xtest = rlq1) Based on 999 replicates Simulated p-value: 0.011 > > > > cleanEx(); ..nameEx <- "rpjdl" > > ### * rpjdl > > flush(stderr()); flush(stdout()) > > ### Name: rpjdl > ### Title: Avifauna and Vegetation > ### Aliases: rpjdl > ### Keywords: datasets > > ### ** Examples > > ## Not run: > ##D data(rpjdl) > ##D xy <- dudi.coa(rpjdl$fau, scann = FALSE)$l1 > ##D s.distri(xy, rpjdl$fau, 2, 1, cstar = 0.3, cell = 0) > ##D > ##D xy1 <- dudi.pca(rpjdl$fau, scal = FALSE, scann = FALSE)$l1 > ##D s.distri(xy1, rpjdl$fau, 2, 1, cstar = 0.3, cell = 0) > ##D > ##D cca1 <- cca(rpjdl$fau, rpjdl$mil, scan = FALSE) > ##D plot(cca1) > ##D > ## End(Not run) > > > cleanEx(); ..nameEx <- "rtest" > > ### * rtest > > flush(stderr()); flush(stdout()) > > ### Name: rtest > ### Title: Class of the Permutation Tests (in R). > ### Aliases: rtest as.rtest plot.rtest print.rtest > ### Keywords: methods > > ### ** Examples > > par(mfrow = c(2,2)) > for (x0 in c(2.4,3.4,5.4,20.4)) { + l0 <- as.rtest(sim = rnorm(200), obs = x0) + print(l0) + plot(l0,main=paste("p.value = ", round(l0$pvalue, dig = 5))) + } Monte-Carlo test Observation: 2.4 Call: as.rtest(sim = rnorm(200), obs = x0) Based on 200 replicates Simulated p-value: 0.009950249 Monte-Carlo test Observation: 3.4 Call: as.rtest(sim = rnorm(200), obs = x0) Based on 200 replicates Simulated p-value: 0.004975124 Monte-Carlo test Observation: 5.4 Call: as.rtest(sim = rnorm(200), obs = x0) Based on 200 replicates Simulated p-value: 0.004975124 Monte-Carlo test Observation: 20.4 Call: as.rtest(sim = rnorm(200), obs = x0) Based on 200 replicates Simulated p-value: 0.004975124 > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "rtest.between" > > ### * rtest.between > > flush(stderr()); flush(stdout()) > > ### Name: rtest.between > ### Title: Monte-Carlo Test on the between-groups inertia percentage (in > ### R). > ### Aliases: rtest.between > ### Keywords: multivariate nonparametric > > ### ** Examples > > data(meaudret) > pca1 <- dudi.pca(meaudret$mil, scan = FALSE, nf = 3) > rand1 <- rtest(between(pca1, meaudret$plan$dat, scan = FALSE), 99) > rand1 Monte-Carlo test Observation: 0.3722686 Call: as.rtest(sim = sim, obs = obs) Based on 99 replicates Simulated p-value: 0.01 > plot(rand1, main = "Monte-Carlo test") > > > > cleanEx(); ..nameEx <- "rtest.discrimin" > > ### * rtest.discrimin > > flush(stderr()); flush(stdout()) > > ### Name: rtest.discrimin > ### Title: Monte-Carlo Test on a Discriminant Analysis (in R). > ### Aliases: rtest.discrimin > ### Keywords: multivariate nonparametric > > ### ** Examples > > data(meaudret) > pca1 <- dudi.pca(meaudret$mil, scan = FALSE, nf = 3) > rand1 <- rtest(discrimin(pca1, meaudret$plan$dat, scan = FALSE), 99) > rand1 Monte-Carlo test Observation: 0.3034897 Call: as.rtest(sim = sim, obs = obs) Based on 99 replicates Simulated p-value: 0.01 > #Monte-Carlo test > #Observation: 0.3035 > #Call: as.rtest(sim = sim, obs = obs) > #Based on 999 replicates > #Simulated p-value: 0.001 > plot(rand1, main = "Monte-Carlo test") > summary.manova(manova(as.matrix(meaudret$mil)~meaudret$plan$dat), "Pillai") Df Pillai approx F num Df den Df Pr(>F) meaudret$plan$dat 3 2.7314 11.2993 27 30 1.636e-09 *** Residuals 16 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > # Df Pillai approx F num Df den Df Pr(>F) > # meaudret$plan$dat 3 2.73 11.30 27 30 1.6e-09 *** > # Residuals 16 > # --- > # Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 > # 2.731/9 = 0.3034 > > > > cleanEx(); ..nameEx <- "s.arrow" > > ### * s.arrow > > flush(stderr()); flush(stdout()) > > ### Name: s.arrow > ### Title: Plot of the factorial maps for the projection of a vector basis > ### Aliases: s.arrow > ### Keywords: multivariate hplot > > ### ** Examples > > s.arrow(cbind.data.frame(runif(55,-2,3), runif(55,-3,2))) > > > > cleanEx(); ..nameEx <- "s.chull" > > ### * s.chull > > flush(stderr()); flush(stdout()) > > ### Name: s.chull > ### Title: Plot of the factorial maps with polygons of contour by level of > ### a factor > ### Aliases: s.chull > ### Keywords: multivariate hplot > > ### ** Examples > > xy <- cbind.data.frame(x = runif(200,-1,1), y = runif(200,-1,1)) > posi <- factor(xy$x > 0) : factor(xy$y > 0) > coul <- c("black", "red", "green", "blue") > s.chull(xy, posi, cpoi = 1.5, col = coul) > > > > cleanEx(); ..nameEx <- "s.class" > > ### * s.class > > flush(stderr()); flush(stdout()) > > ### Name: s.class > ### Title: Plot of factorial maps with representation of point classes > ### Aliases: s.class > ### Keywords: multivariate hplot > > ### ** Examples > > xy <- cbind.data.frame(x = runif(200,-1,1), y = runif(200,-1,1)) > posi <- factor(xy$x > 0) : factor(xy$y > 0) > coul <- c("black", "red", "green", "blue") > par(mfrow = c(2,2)) > s.class(xy, posi, cpoi = 2) > s.class(xy, posi, cell = 0, cstar = 0.5) > s.class(xy, posi, cell = 2, axesell = FALSE, csta = 0, col = coul) > s.chull(xy, posi, cpoi = 1) > par(mfrow = c(1,1)) > > ## Not run: > ##D data(banque) > ##D dudi1 <- dudi.acm(banque, scannf = FALSE) > ##D coul = rainbow(length(levels(banque[,20]))) > ##D par(mfrow = c(2,2)) > ##D s.label(dudi1$li, sub = "Factorial map from ACM", csub = 1.5, > ##D possub = "topleft") > ##D s.class(dudi1$li, banque[,20], sub = names(banque)[20], > ##D possub = "bottomright", cell = 0, cstar = 0.5, cgrid = 0, csub = 1.5) > ##D s.class(dudi1$li, banque[,20], csta = 0, cell = 2, cgrid = 0, > ##D clab = 1.5) > ##D s.class(dudi1$li, banque[,20], sub = names(banque)[20], > ##D possub = "topright", cgrid = 0, col = coul) > ##D par(mfrow = c(1,1)) > ##D > ##D par(mfrow = n2mfrow(ncol(banque))) > ##D for (i in 1:(ncol(banque))) > ##D s.class(dudi1$li, banque[,i], clab = 1.5, sub = names(banque)[i], > ##D csub = 2, possub = "topleft", cgrid = 0, csta = 0, cpoi = 0) > ##D s.label(dudi1$li, clab = 0, sub = "Common background") > ##D par(mfrow = c(1,1)) > ## End(Not run) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "s.corcircle" > > ### * s.corcircle > > flush(stderr()); flush(stdout()) > > ### Name: s.corcircle > ### Title: Plot of the factorial maps of a correlation circle > ### Aliases: s.corcircle > ### Keywords: multivariate hplot > > ### ** Examples > > data (olympic) > dudi1 <- dudi.pca(olympic$tab, scan = FALSE) # a normed PCA > par(mfrow = c(2,2)) > s.corcircle(dudi1$co, lab = names(olympic$tab)) > s.corcircle(dudi1$co, cgrid = 0, full = FALSE, clab = 0.8) > s.corcircle(dudi1$co, lab = as.character(1:11), cgrid = 2, + full = FALSE, sub = "Correlation circle", csub = 2.5, + possub = "bottomleft", box = TRUE) > s.arrow(dudi1$co, clab = 1) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "s.distri" > > ### * s.distri > > flush(stderr()); flush(stdout()) > > ### Name: s.distri > ### Title: Plot of a frequency distribution > ### Aliases: s.distri > ### Keywords: multivariate hplot > > ### ** Examples > > xy <- cbind.data.frame(x = runif(200,-1,1), y = runif(200,-1,1)) > distri <- data.frame(w1 = rpois(200, xy$x * (xy$x > 0))) > s.value(xy, distri$w1, cpoi = 1) > s.distri(xy, distri, add.p = TRUE) > > w1 <- as.numeric((xy$x> 0) & (xy$y > 0)) > w2 <- ((xy$x > 0) & (xy$y < 0)) * (1 - xy$y) * xy$x > w3 <- ((xy$x < 0) & (xy$y > 0)) * (1 - xy$x) * xy$y > w4 <- ((xy$x < 0) & (xy$y < 0)) * xy$y * xy$x > > distri <- data.frame(a = w1 / sum(w1), b = w2 / sum(w2), + c = w3 / sum(w3), d = w4 / sum(w4)) > s.value(xy, unlist(apply(distri, 1, sum)), cleg = 0, csi = 0.75) > s.distri(xy, distri, clab = 2, add.p = TRUE) > > data(rpjdl) > xy <- dudi.coa(rpjdl$fau, scan = FALSE)$li > par(mfrow = c(3,4)) > for (i in c(1,5,8,20,21,23,26,33,36,44,47,49)){ + s.distri(xy, rpjdl$fau[,i], cell = 1.5, sub = rpjdl$frlab[i], + csub = 2, cgrid = 1.5)} > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "s.hist" > > ### * s.hist > > flush(stderr()); flush(stdout()) > > ### Name: s.hist > ### Title: Display of a scatterplot and its two marginal histograms > ### Aliases: s.hist > ### Keywords: multivariate hplot > > ### ** Examples > > data(rpjdl) > coa1 <- dudi.coa(rpjdl$fau, scannf = FALSE, nf = 4) > s.hist(coa1$li) [1] 10 20 30 > s.hist(coa1$li, cgrid = 2, cbr = 3, adj = 0.5, clab = 0) [1] 5 10 15 20 25 30 > s.hist(coa1$co, cgrid = 2, cbr = 3, adj = 0.5, clab = 0) [1] 5 10 15 > > > > cleanEx(); ..nameEx <- "s.image" > > ### * s.image > > flush(stderr()); flush(stdout()) > > ### Name: s.image > ### Title: Graph of a variable using image and contour > ### Aliases: s.image > ### Keywords: hplot > > ### ** Examples > > > if (require(splancs, quiet = TRUE)){ + wxy=data.frame(expand.grid(-3:3,-3:3)) + names(wxy)=c("x","y") + z=(1/sqrt(2))*exp(-(wxy$x^2+wxy$y^2)/2) + par(mfrow=c(2,2)) + s.value(wxy,z) + s.image(wxy,z) + s.image(wxy,z,kgrid=5) + s.image(wxy,z,kgrid=15) + } Spatial Point Pattern Analysis Code in S-Plus Version 2 - Spatial and Space-Time analysis > > ## Not run: > ##D data(t3012) > ##D if (require(splancs, quiet = TRUE)){ > ##D par(mfrow = c(4,4)) > ##D for(k in 1:12) s.image(t3012$xy,scalewt(t3012$temp[,k]), kgrid = 3) > ##D par(mfrow = c(1,1)) > ##D } > ##D > ##D data(elec88) > ##D if (require(splancs, quiet = TRUE)){ > ##D par(mfrow = c(4,4)) > ##D for(k in 1:12) > ##D s.image(t3012$xy, scalewt(t3012$temp[,k]), kgrid = 3, sub = names(t3012$temp)[k], > ##D csub = 3, area = elec88$area) > ##D par(mfrow = c(1,1)) > ##D } > ## End(Not run) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "s.kde2d" > > ### * s.kde2d > > flush(stderr()); flush(stdout()) > > ### Name: s.kde2d > ### Title: Scatter Plot with Kernel Density Estimate > ### Aliases: s.kde2d > ### Keywords: multivariate hplot > > ### ** Examples > > # To recognize groups of points > data(casitas) > casitas.fuz = fuzzygenet(casitas) > casitas.pop <- as.factor(rep(c("dome", "cast", "musc", "casi"), c(24,11,9,30))) > casitas.pca = dudi.pca(casitas.fuz, scannf = FALSE, scale = FALSE) > if (require(MASS, quiet=TRUE)) {s.kde2d(casitas.pca$li) + s.class(casitas.pca$li,casitas.pop, cell = 0, add.p = TRUE) + } > > > > cleanEx(); ..nameEx <- "s.label" > > ### * s.label > > flush(stderr()); flush(stdout()) > > ### Name: s.label > ### Title: Scatter Plot > ### Aliases: s.label > ### Keywords: multivariate hplot > > ### ** Examples > > layout(matrix(c(1,2,3,2), 2, 2)) > data(atlas) > s.label(atlas$xy, lab = atlas$names.district, + area = atlas$area, inc = FALSE, addax = FALSE) > data(mafragh) > s.label(mafragh$xy, inc = FALSE, neig = mafragh$neig, addax = FALSE) > data(irishdata) > s.label(irishdata$xy, inc = FALSE, contour = irishdata$contour, + addax = FALSE) > > par(mfrow = c(2,2)) > cha <- ls() > s.label(cbind.data.frame(runif(length(cha)), + runif(length(cha))), lab = cha) > x <- runif(50,-2,2) ; y <- runif(50,-2,2) ; z <- x^2 + y^2 > s.label(data.frame(x,y), lab = as.character(z < 1)) > s.label(data.frame(x,y), clab = 0, cpoi = 1, add.plot = TRUE) > symbols(0, 0, circles = 1, add = TRUE, inch = FALSE) > s.label(cbind.data.frame(runif(100,0,10), runif(100,5,12)), + incl = FALSE, clab = 0) > s.label(cbind.data.frame(runif(100,-3,12), + runif(100,2,10)), cl = 0, cp = 2, include = FALSE) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "s.match" > > ### * s.match > > flush(stderr()); flush(stdout()) > > ### Name: s.match > ### Title: Plot of Paired Coordinates > ### Aliases: s.match > ### Keywords: multivariate hplot > > ### ** Examples > > X <- data.frame(x = runif(50,-1,2), y = runif(50,-1,2)) > Y <- X + rnorm(100, sd = 0.3) > par(mfrow = c(2,2)) > s.match(X, Y) > s.match(X, Y, edge = FALSE, clab = 0) > s.match(X, Y, edge = FALSE, clab = 0) > s.label(X, clab = 1, add.plot = TRUE) > s.label(Y, clab = 0.75, add.plot = TRUE) > s.match(Y, X, clab = 0) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "s.traject" > > ### * s.traject > > flush(stderr()); flush(stdout()) > > ### Name: s.traject > ### Title: Trajectory Plot > ### Aliases: s.traject > ### Keywords: multivariate hplot > > ### ** Examples > > rw <- function(a){ + x <- 0 + for(i in 1:49) x <- c(x,x[length(x)] + runif(1,-1,1)) + x + } > y <- unlist(lapply(1:5, rw)) > x <- unlist(lapply(1:5, rw)) > z <- gl(5,50) > s.traject(data.frame(x,y), z, edge = FALSE) > > > > cleanEx(); ..nameEx <- "s.value" > > ### * s.value > > flush(stderr()); flush(stdout()) > > ### Name: s.value > ### Title: Representation of a value in a graph > ### Aliases: s.value > ### Keywords: multivariate hplot > > ### ** Examples > > xy <- cbind.data.frame(x = runif(500), y = runif(500)) > z <- rnorm(500) > s.value(xy, z) > > s.value(xy, z, method = "greylevel") > > data(rpjdl) > fau.coa <- dudi.coa(rpjdl$fau, scan = FALSE, nf = 3) > s.value(fau.coa$li, fau.coa$li[,3], csi = 0.75, cleg = 0.75) > > data(irishdata) > par(mfrow = c(3,4)) > irq0 <- data.frame(scale(irishdata$tab, scale = TRUE)) > for (i in 1:12) { + z <- irq0[,i] ; nam <- names(irq0)[i] + s.value(irishdata$xy, irq0[,1], area = irishdata$area, csi = 3, + csub = 2, sub = nam, cleg = 1.5, cgrid = 0, inc = FALSE, + xlim = c(16,205), ylim = c(-50,268), adda = FALSE, grid = FALSE) + } > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "santacatalina" > > ### * santacatalina > > flush(stderr()); flush(stdout()) > > ### Name: santacatalina > ### Title: Indirect Ordination > ### Aliases: santacatalina > ### Keywords: datasets > > ### ** Examples > > data(santacatalina) > par(mfrow = c(2,2)) > table.value(log(santacatalina + 1), grid = TRUE) > table.value(log(santacatalina + 1)[,sample(10)], grid = TRUE) > coa1 <- dudi.coa(log(santacatalina + 1), scan = FALSE) # 2 factors > table.value(log(santacatalina + 1)[order(coa1$li[,1]), + order(coa1$co[,1])], grid = TRUE) > scatter(coa1, posi = "bottom") > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "sarcelles" > > ### * sarcelles > > flush(stderr()); flush(stdout()) > > ### Name: sarcelles > ### Title: Array of Recapture of Rings > ### Aliases: sarcelles > ### Keywords: datasets > > ### ** Examples > > ## Not run: > ##D # depends of pixmap > ##D if (require(pixmap, quietly=TRUE)) { > ##D bkgnd.pnm <- read.pnm(system.file("pictures/sarcelles.pnm", package = "ade4")) > ##D data(sarcelles) > ##D par(mfrow = c(4,3)) > ##D for(i in 1:12) { > ##D s.distri(sarcelles$xy, sarcelles$tab[,i], pixmap = bkgnd.pnm, > ##D sub = sarcelles$col.names[i], clab = 0, csub = 2) > ##D s.value(sarcelles$xy, sarcelles$tab[,i], add.plot = TRUE, cleg = 0) > ##D } > ##D } > ## End(Not run) > > > cleanEx(); ..nameEx <- "scalewt" > > ### * scalewt > > flush(stderr()); flush(stdout()) > > ### Name: scalewt > ### Title: Centring and Scaling a Matrix of Any Weighting > ### Aliases: scalewt > ### Keywords: utilities > > ### ** Examples > > scalewt(matrix(1:12,4,3)) [,1] [,2] [,3] [1,] -1.3416408 -1.3416408 -1.3416408 [2,] -0.4472136 -0.4472136 -0.4472136 [3,] 0.4472136 0.4472136 0.4472136 [4,] 1.3416408 1.3416408 1.3416408 > scale((matrix(1:12,4,3))) [,1] [,2] [,3] [1,] -1.1618950 -1.1618950 -1.1618950 [2,] -0.3872983 -0.3872983 -0.3872983 [3,] 0.3872983 0.3872983 0.3872983 [4,] 1.1618950 1.1618950 1.1618950 attr(,"scaled:center") [1] 2.5 6.5 10.5 attr(,"scaled:scale") [1] 1.290994 1.290994 1.290994 > scale(matrix(1,4,3)) [,1] [,2] [,3] [1,] NaN NaN NaN [2,] NaN NaN NaN [3,] NaN NaN NaN [4,] NaN NaN NaN attr(,"scaled:center") [1] 1 1 1 attr(,"scaled:scale") [1] 0 0 0 > scalewt(matrix(1,4,3)) [,1] [,2] [,3] [1,] 0 0 0 [2,] 0 0 0 [3,] 0 0 0 [4,] 0 0 0 > > > > cleanEx(); ..nameEx <- "scatter" > > ### * scatter > > flush(stderr()); flush(stdout()) > > ### Name: scatter > ### Title: Scatter Plot > ### Aliases: scatter scatterutil.base add.scatter.eig scatterutil.chull > ### scatterutil.eigen scatterutil.ellipse scatterutil.eti.circ > ### scatterutil.eti scatterutil.grid scatterutil.legend.bw.square > ### scatterutil.legend.square.grey scatterutil.legendgris > ### scatterutil.scaling scatterutil.star scatterutil.sub > ### Keywords: multivariate hplot > > ### ** Examples > > par(mfrow = c(3,3)) > plot.new() > scatterutil.legendgris(1:20, 4, 1.6) > > plot.new() > scatterutil.sub("lkn5555555555lkn", csub = 2, possub = "bottomleft") > scatterutil.sub("lkn5555555555lkn", csub = 1, possub = "topleft") > scatterutil.sub("jdjjl", csub = 3, possub = "topright") > scatterutil.sub("**", csub = 2, possub = "bottomright") > > x <- c(0.5,0.2,-0.5,-0.2) ; y <- c(0.2,0.5,-0.2,-0.5) > eti <- c("toto", "kjbk", "gdgiglgl", "sdfg") > plot(x, y, xlim = c(-1,1), ylim = c(-1,1)) > scatterutil.eti.circ(x, y, eti, 2.5) > abline(0, 1, lty = 2) ; abline(0, -1, lty = 2) > > x <- c(0.5,0.2,-0.5,-0.2) ; y <- c(0.2,0.5,-0.2,-0.5) > eti <- c("toto", "kjbk", "gdgiglgl", "sdfg") > plot(x, y, xlim = c(-1,1), ylim = c(-1,1)) > scatterutil.eti(x, y, eti, 1.5) > > plot(runif(10,-3,5), runif(10,-1,1), asp = 1) > scatterutil.grid(2) > abline(h = 0, v = 0, lwd = 3) > > x <- runif(10,0,1) ; y <- rnorm(10) ; z <- rep(1,10) > plot(x,y) ; scatterutil.star(x, y, z, 0.5) > plot(x,y) ; scatterutil.star(x, y, z, 1) > > x <- c(runif(10,0,0.5), runif(10,0.5,1)) > y <- runif(20) > plot(x, y, asp = 1) # asp=1 is essential to have perpendicular axes > scatterutil.ellipse(x, y, rep(c(1,0), c(10,10)), cell = 1.5, ax = TRUE) > scatterutil.ellipse(x, y, rep(c(0,1), c(10,10)), cell = 1.5, ax = TRUE) > > x <- c(runif(100,0,0.75), runif(100,0.25,1)) > y <- c(runif(100,0,0.75), runif(100,0.25,1)) > z <- factor(rep(c(1,2), c(100,100))) > plot(x, y, pch = rep(c(1,20), c(100,100))) > scatterutil.chull(x, y, z, opt = c(0.25,0.50,0.75,1)) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "scatter.acm" > > ### * scatter.acm > > flush(stderr()); flush(stdout()) > > ### Name: scatter.acm > ### Title: Plot of the factorial maps in multiple correspondence analysis > ### Aliases: scatter.acm > ### Keywords: multivariate hplot > > ### ** Examples > > data(lascaux) > scatter(dudi.acm(lascaux$ornem, sca = FALSE), csub = 3) > > > > cleanEx(); ..nameEx <- "scatter.coa" > > ### * scatter.coa > > flush(stderr()); flush(stdout()) > > ### Name: scatter.coa > ### Title: Plot of the factorial maps for a correspondence analysis > ### Aliases: scatter.coa > ### Keywords: multivariate hplot > > ### ** Examples > > data(housetasks) > par(mfrow = c(2,2)) > w <- dudi.coa(housetasks, scan = FALSE) > scatter.dudi(w, sub = "0 / To be avoided") > scatter.coa(w, method = 1, sub = "1 / Standard", posieig = "none") > scatter.coa(w, method = 2, + sub = "2 / Columns -> averaging -> Rows", posieig = "none") > scatter.coa(w, method = 3, + sub = "3 / Rows -> averaging -> Columns ", posieig = "none") > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "scatter.dudi" > > ### * scatter.dudi > > flush(stderr()); flush(stdout()) > > ### Name: scatter.dudi > ### Title: Plot of the Factorial Maps > ### Aliases: scatter.dudi > ### Keywords: multivariate hplot > > ### ** Examples > > data(deug) > scatter(dd1 <- dudi.pca(deug$tab, scannf = FALSE, nf = 4), + posieig = "bottom") > > data(rhone) > dd1 <- dudi.pca(rhone$tab, nf = 4, scann = FALSE) > scatter(dd1, sub = "Principal component analysis") > > > > cleanEx(); ..nameEx <- "scatter.fca" > > ### * scatter.fca > > flush(stderr()); flush(stdout()) > > ### Name: scatter.fca > ### Title: Plot of the factorial maps for a fuzzy correspondence analysis > ### Aliases: scatter.fca > ### Keywords: multivariate hplot > > ### ** Examples > > data(coleo) > coleo.fuzzy <- prep.fuzzy.var(coleo$tab, coleo$col.blocks) 2 missing data found in block 1 1 missing data found in block 3 2 missing data found in block 4 > fca1 <- dudi.fca(coleo.fuzzy, sca = FALSE, nf = 3) > scatter(fca1, labels = coleo$moda.names, clab.moda = 1.5, + sub = names(coleo$col.blocks), csub = 3) > > > > cleanEx(); ..nameEx <- "sco.boxplot" > > ### * sco.boxplot > > flush(stderr()); flush(stdout()) > > ### Name: sco.boxplot > ### Title: Representation of the link between a variable and a set of > ### qualitative variables > ### Aliases: sco.boxplot > ### Keywords: multivariate hplot > > ### ** Examples > > w1 <- rnorm(100,-1) > w2 <- rnorm(100) > w3 <- rnorm(100,1) > f1 <- gl(3,100) > f2 <- gl(30,10) > sco.boxplot(c(w1,w2,w3), data.frame(f1,f2)) > > data(banque) > banque.acm <- dudi.acm(banque, scan = FALSE, nf = 4) > par(mfrow = c(1,3)) > sco.boxplot(banque.acm$l1[,1], banque[,1:7], clab = 1.8) > sco.boxplot(banque.acm$l1[,1], banque[,8:14], clab = 1.8) > sco.boxplot(banque.acm$l1[,1], banque[,15:21], clab = 1.8) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "sco.distri" > > ### * sco.distri > > flush(stderr()); flush(stdout()) > > ### Name: sco.distri > ### Title: Representation by mean- standard deviation of a set of weight > ### distributions on a numeric score > ### Aliases: sco.distri > ### Keywords: multivariate hplot > > ### ** Examples > > w <-seq(-1, 1, le = 200) > distri <- data.frame(lapply(1:50, + function(x) sample((200:1)) * ((w >= (-x/50)) & (w <= x/50)) )) > names(distri) <- paste("w", 1:50, sep = "") > par(mfrow = c(1,2)) > sco.distri(w, distri, csi = 1.5) > sco.distri(w, distri, y.rank = FALSE, csi = 1.5) > par(mfrow = c(1,1)) > > data(rpjdl) > coa2 <- dudi.coa(rpjdl$fau, FALSE) > sco.distri(coa2$li[,1], rpjdl$fau, lab = rpjdl$frlab, clab = 0.8) > > data(doubs) > par(mfrow = c(2,2)) > poi.coa <- dudi.coa(doubs$poi, scann = FALSE) > sco.distri(poi.coa$l1[,1], doubs$poi) > poi.nsc <- dudi.nsc(doubs$poi, scann = FALSE) > sco.distri(poi.nsc$l1[,1], doubs$poi) > s.label(poi.coa$l1) > s.label(poi.nsc$l1) > > data(rpjdl) > fau.coa <- dudi.coa(rpjdl$fau, scann = FALSE) > sco.distri(fau.coa$l1[,1], rpjdl$fau) > fau.nsc <- dudi.nsc(rpjdl$fau, scann = FALSE) > sco.distri(fau.nsc$l1[,1], rpjdl$fau) > s.label(fau.coa$l1) > s.label(fau.nsc$l1) > > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "sco.quant" > > ### * sco.quant > > flush(stderr()); flush(stdout()) > > ### Name: sco.quant > ### Title: Graph to Analyse the Relation between a Score and Quantitative > ### Variables > ### Aliases: sco.quant > ### Keywords: hplot multivariate > > ### ** Examples > > w <- runif(100, -5, 10) > fw <- cut (w, 5) > levels(fw) <- LETTERS[1:5] > wX <- data.frame(matrix(w + rnorm(900, sd = (1:900) / 100), 100, 9)) > sco.quant(w, wX, fac = fw, abline = TRUE, clab = 2, csub = 3) > > > > cleanEx(); ..nameEx <- "score" > > ### * score > > flush(stderr()); flush(stdout()) > > ### Name: score > ### Title: Graphs for One Dimension > ### Aliases: score scoreutil.base > ### Keywords: multivariate hplot > > ### ** Examples > > ## Not run: > ##D par(mar = c(1,1,1,1)) > ##D scoreutil.base (runif(20,3,7), xlim = NULL, grid = TRUE, cgrid = 0.8, > ##D include.origin = TRUE, origin = 0, sub = "Uniform", csub = 1) > ## End(Not run) > # returns the value of the user coordinate of the low line. > # The user window id defined with c(0,1) in ordinate. > # box() > > > > cleanEx(); ..nameEx <- "score.acm" > > ### * score.acm > > flush(stderr()); flush(stdout()) > > ### Name: score.acm > ### Title: Graphs to study one factor in a Multiple Correspondence Analysis > ### Aliases: score.acm > ### Keywords: multivariate hplot > > ### ** Examples > > data(banque) > banque.acm <- dudi.acm(banque, scann = FALSE, nf = 3) > score(banque.acm, which = which(banque.acm$cr[,1] > 0.2), csub = 3) > > > > cleanEx(); ..nameEx <- "score.coa" > > ### * score.coa > > flush(stderr()); flush(stdout()) > > ### Name: score.coa > ### Title: Graphs to analyse a factor in a correspondence analysis > ### Aliases: score.coa > ### Keywords: multivariate hplot > > ### ** Examples > > layout(matrix(c(1,1,2,3), 2, 2), resp = FALSE) > data(aviurba) > dd1 <- dudi.coa(aviurba$fau, scan = FALSE) > score(dd1, clab.r = 0, clab.c = 0.75) > abline(v = 1, lty = 2, lwd = 3) > sco.distri(dd1$l1[,1], aviurba$fau) > sco.distri(dd1$c1[,1], data.frame(t(aviurba$fau))) > > # 1 reciprocal scaling correspondence score -> species amplitude + sample diversity > # 2 sample score -> averaging -> species amplitude > # 3 species score -> averaging -> sample diversity > > layout(matrix(c(1,1,2,3), 2, 2), resp = FALSE) > data(rpjdl) > rpjdl1 <- dudi.coa(rpjdl$fau, scan = FALSE) > score(rpjdl1, clab.r = 0, clab.c = 0.75) > if (require(MASS, quietly = TRUE)) { + data(caith) + score(dudi.coa(caith, scan = FALSE), clab.r = 1.5, clab.c = 1.5, cpoi = 3) + data(housetasks) + score(dudi.coa(housetasks, scan = FALSE), clab.r = 1.25, clab.c = 1.25, + csub = 0, cpoi = 3) + } > par(mfrow = c(1,1)) > score(rpjdl1, dotchart = TRUE, clab.r = 0) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "score.mix" > > ### * score.mix > > flush(stderr()); flush(stdout()) > > ### Name: score.mix > ### Title: Graphs to Analyse a factor in a Mixed Analysis > ### Aliases: score.mix > ### Keywords: multivariate hplot > > ### ** Examples > > data(lascaux) > w <- cbind.data.frame(lascaux$colo, lascaux$ornem) > dd <- dudi.mix(w, scan = FALSE, nf = 4, add = TRUE) > score(dd, which = which(dd$cr[,1] > 0.3)) > > > > cleanEx(); ..nameEx <- "score.pca" > > ### * score.pca > > flush(stderr()); flush(stdout()) > > ### Name: score.pca > ### Title: Graphs to Analyse a factor in PCA > ### Aliases: score.pca > ### Keywords: multivariate hplot > > ### ** Examples > > data(deug) > dd1 <- dudi.pca(deug$tab, scan = FALSE) > score(dd1, csub = 3) > > # The correlations are : > dd1$co[,1] [1] 0.7924753 0.6531896 0.7410261 0.5287294 0.5538660 0.7416171 0.3336153 [8] 0.2755026 0.4171874 > # [1] 0.7925 0.6532 0.7410 0.5287 0.5539 0.7416 0.3336 0.2755 0.4172 > > > > cleanEx(); ..nameEx <- "seconde" > > ### * seconde > > flush(stderr()); flush(stdout()) > > ### Name: seconde > ### Title: Students and Subjects > ### Aliases: seconde > ### Keywords: datasets > > ### ** Examples > > data(seconde) > scatter(dudi.pca(seconde, scan = FALSE), clab.r = 1, clab.c = 1.5) > > > > cleanEx(); ..nameEx <- "sepan" > > ### * sepan > > flush(stderr()); flush(stdout()) > > ### Name: sepan > ### Title: Separated Analyses in a K-tables > ### Aliases: sepan plot.sepan print.sepan summary.sepan > ### Keywords: multivariate > > ### ** Examples > > data(escopage) > w <- data.frame(scale(escopage$tab)) > w <- ktab.data.frame(w, escopage$blo, tabnames = escopage$tab.names) > sep1 <- sepan(w) > sep1 class: sepan list $call: sepan(X = w) vector length mode content 1 $tab.names 4 character tab names 2 $blo 4 numeric column number 3 $rank 4 numeric tab rank 4 $Eig 27 numeric All the eigen values data.frame nrow ncol content 1 $Li 84 2 row coordinates 2 $L1 84 2 row normed scores 3 $Co 27 2 column coordinates 4 $C1 27 2 column normed coordinates 5 $TL 84 2 factors for Li L1 6 $TC 27 2 factors for Co C1 > summary(sep1) Separate Analyses of a 'ktab' object names nrow ncol rank lambda1 lambda2 lambda3 lambda4 1 repos 21 5 5 2.135 1.444 0.777 0.268 ... 2 visual 21 3 3 2.7 0.144 0.014 3 olfactif 21 10 10 4.478 2.365 0.996 0.729 ... 4 general 21 9 9 5.373 1.706 0.642 0.334 ... > plot(sep1) > > > > cleanEx(); ..nameEx <- "skulls" > > ### * skulls > > flush(stderr()); flush(stdout()) > > ### Name: skulls > ### Title: Morphometric Evolution > ### Aliases: skulls > ### Keywords: datasets > > ### ** Examples > > data(skulls) > pca1 <- dudi.pca(skulls, scan = FALSE) > fac <- gl(5, 30) > levels(fac) <- c("-4000", "-3300", "-1850", "-200", "+150") > dis.skulls <- discrimin(pca1, fac, scan = FALSE) > plot(dis.skulls, 1, 1) > > > > cleanEx(); ..nameEx <- "statis" > > ### * statis > > flush(stderr()); flush(stdout()) > > ### Name: statis > ### Title: STATIS, a method for analysing K-tables > ### Aliases: statis print.statis plot.statis > ### Keywords: multivariate > > ### ** Examples > > data(jv73) > kta1 <- ktab.within(within.pca(jv73$morpho, jv73$fac.riv, scann = FALSE)) > statis1 <- statis(kta1, scann = FALSE) > plot(statis1) > > dudi1 <- dudi.pca(jv73$poi, scann = FALSE, scal = FALSE) > wit1 <- within(dudi1, jv73$fac.riv, scann = FALSE) > kta3 <- ktab.within(wit1) > data(jv73) > statis3 <- statis(kta3, scann = FALSE) > plot(statis3) > > s.arrow(statis3$C.li, cgrid = 0) > > kplot(statis3, traj = TRUE, arrow = FALSE, unique = TRUE, + clab = 0, csub = 3, cpoi = 3) > statis3 STATIS Analysis class:statis table number: 12 row number: 19 total column number: 92 **** Interstructure **** eigen values: 5.337 1.525 1.294 1.037 0.6419 ... $RV matrix 12 12 RV coefficients $RV.eig vector 12 eigenvalues $RV.coo data.frame 12 4 array scores $tab.names vector 12 array names $RV.tabw vector 12 array weigths RV coefficient Doubs Drugeon Dessoubre Allaine Audeux Cusancin Doubs 1.0000000 Drugeon 0.4214976 1.00000000 Dessoubre 0.5560554 0.09888345 1.0000000 Allaine 0.4162722 0.33016274 0.4264883 1.0000000 Audeux 0.5275275 0.09998470 0.7460391 0.3923156 1.0000000 Cusancin 0.2648507 0.14357569 0.4098816 0.6750590 0.4465916 1.0000000 Loue 0.4396741 0.31081167 0.2031117 0.3872305 0.1128074 0.3069628 Lison 0.4181009 0.07442131 0.4814447 0.2312130 0.3968212 0.3982919 Furieuse 0.2782714 0.18165914 0.4089889 0.3844109 0.3291450 0.6693345 Cuisance 0.4196404 0.22095719 0.4596960 0.4881191 0.3045202 0.5962413 Doulonnes 0.2183520 0.06715160 0.4014573 0.2401718 0.3781006 0.2987118 Clauge 0.4599651 0.51530332 0.2912210 0.4142577 0.2568859 0.2351574 Loue Lison Furieuse Cuisance Doulonnes Clauge Doubs Drugeon Dessoubre Allaine Audeux Cusancin Loue 1.0000000 Lison 0.3597613 1.0000000 Furieuse 0.3862660 0.5209446 1.0000000 Cuisance 0.6487130 0.6310371 0.7768327 1.0000000 Doulonnes 0.3005171 0.5346002 0.4748992 0.5445763 1.0000000 Clauge 0.5192117 0.2895775 0.3259230 0.4934249 0.3310817 1 **** Compromise **** eigen values: 2.012 0.903 0.5025 0.3003 0.2282 ... $nf: 3 axis-components saved $rank: 19 data.frame nrow ncol content $C.li 19 3 row coordinates $C.Co 92 3 column coordinates $T4 48 2 principal vectors (each table) $TL 228 2 factors (not used) $TC 92 2 factors for Co $T4 48 2 factors for T4 > > > > cleanEx(); ..nameEx <- "steppe" > > ### * steppe > > flush(stderr()); flush(stdout()) > > ### Name: steppe > ### Title: Transect in the Vegetation > ### Aliases: steppe > ### Keywords: datasets > > ### ** Examples > > par(mfrow = c(3,1)) > data(steppe) > w1 <- col(as.matrix(steppe$tab[,1:15])) > w1 <- as.numeric(w1[steppe$tab[,1:15] > 0]) > w2 <- row(as.matrix(steppe$tab[,1:15])) > w2 <- as.numeric(w2[steppe$tab[,1:15] > 0]) > plot(w2, w1, pch = 20) > plot(dudi.pca(steppe$tab, scan = FALSE, scale = FALSE)$li[,1], + pch = 20, ylab = "PCA", xlab = "", type = "b") > plot(dudi.coa(steppe$tab, scan = FALSE)$li[,1], pch = 20, + ylab = "COA", xlab = "", type = "b") > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "supcol" > > ### * supcol > > flush(stderr()); flush(stdout()) > > ### Name: supcol > ### Title: Projections of Supplementary Columns > ### Aliases: supcol supcol.coa supcol.default > ### Keywords: multivariate > > ### ** Examples > > data(rpjdl) > rpjdl.coa <- dudi.coa(rpjdl$fau, scan = FALSE, nf = 4) > rpjdl.coa$co[1:3,] Comp1 Comp2 Comp3 Comp4 AR 1.3906689 -0.4366455 0.0899963 -0.4036248 CP -0.8298783 -0.2134175 0.9950055 -0.8763367 ST -0.6045373 0.1035953 0.6820577 -0.4254950 > supcol (rpjdl.coa,rpjdl$fau[,1:3])$cosup # the same Comp1 Comp2 Comp3 Comp4 AR 1.3906689 -0.4366455 0.0899963 -0.4036248 CP -0.8298783 -0.2134175 0.9950055 -0.8763367 ST -0.6045373 0.1035953 0.6820577 -0.4254950 > > data(doubs) > dudi1 <- dudi.pca(doubs$poi, scal = FALSE, scan = FALSE) > s.arrow(dudi1$co) > s.arrow(supcol.default(dudi1,data.frame(scalewt(doubs$mil)))$cosup, + add.p = TRUE, clab = 2) > symbols(0, 0, circles = 1, inches = FALSE, add = TRUE) > > > > cleanEx(); ..nameEx <- "suprow" > > ### * suprow > > flush(stderr()); flush(stdout()) > > ### Name: suprow > ### Title: Projections of Supplementary Rows > ### Aliases: suprow suprow.coa suprow.pca suprow.default > ### Keywords: multivariate > > ### ** Examples > > data(euro123) > par(mfrow = c(2,2)) > w <- euro123[[2]] > dudi1 <- dudi.pca(w, scal = FALSE, scan = FALSE) > s.arrow(dudi1$c1, sub = "Classical", possub = "bottomright", csub = 2.5) > s.label(suprow(dudi1,w), add.plot = TRUE, clab = 0.75) > > s.arrow(dudi1$c1, + sub = "Without centring", possub = "bottomright", csub = 2.5) > s.label(suprow.default(dudi1,w), clab = 0.75, add.plot = TRUE) > > triangle.plot(w, clab = 0.75, label = row.names(w), scal = FALSE) > triangle.plot(w, clab = 0.75, label = row.names(w), scal = TRUE) > > data(rpjdl) > rpjdl.coa <- dudi.coa(rpjdl$fau, scann = FALSE, nf = 4) > rpjdl.coa$li[1:3,] Axis1 Axis2 Axis3 Axis4 1 1.449656 -1.59644004 1.2912481 2.0346309 2 1.308057 -1.56619615 1.2428411 1.6905682 3 1.042200 0.00201931 0.2788701 0.1574388 > suprow(rpjdl.coa,rpjdl$fau[1:3,]) # idem $tabsup AR CP ST CC UE PV JT GT LA OO PP GG PM PC PR AA SE CB TT TM MS 1 0 0 0 0 0.0000000 0 0 0.000 0 0 0 0 0 0 0 0 0 0 0 0 0.125 2 0 0 0 0 0.0000000 0 0 0.125 0 0 0 0 0 0 0 0 0 0 0 0 0.125 3 0 0 0 0 0.1428571 0 0 0.000 0 0 0 0 0 0 0 0 0 0 0 0 0.000 MO OH OL SO LM ER HP SH SB SA SC SM SN SP SU PB Rl PO 1 0.125 0.1250000 0.1250000 0.0000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0.125 0.1250000 0.1250000 0.0000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0.000 0.1428571 0.1428571 0.1428571 0 0 0 0 0 0 0 0 0 0 0 0 0 0 AC LS CH CA CN SS FC MC EC EH El PD 1 0.125 0 0 0.125 0.1250000 0.0000000 0 0 0 0 0.0000000 0.125 2 0.125 0 0 0.125 0.0000000 0.1250000 0 0 0 0 0.0000000 0.000 3 0.000 0 0 0.000 0.1428571 0.1428571 0 0 0 0 0.1428571 0.000 $lisup Axis1 Axis2 Axis3 Axis4 1 1.449656 -1.59644004 1.2912481 2.0346309 2 1.308057 -1.56619615 1.2428411 1.6905682 3 1.042200 0.00201931 0.2788701 0.1574388 > > data(deug) > deug.dudi <- dudi.pca(df = deug$tab, center = deug$cent, + scale = FALSE, scannf = FALSE) > suprow(deug.dudi, deug$tab[1:3,]) # the supplementary individuals are centered $tabsup Algebra Analysis Proba Informatic Economy Option1 Option2 English Sport 1 -10 -4.0 -14 -4.0 -8.1 -3 4 -1.0 11.5 2 -13 4.5 -3 2.0 12.0 4 2 6.0 11.5 3 -13 11.0 -11 4.5 12.0 4 7 -0.4 11.5 $lisup Axis1 Axis2 1 -14.86352 12.399345 2 -16.49579 -8.738351 3 -21.97732 -9.038219 > deug.dudi$li[1:3,] # idem Axis1 Axis2 1 -14.86352 12.399345 2 -16.49579 -8.738351 3 -21.97732 -9.038219 > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "symbols.phylog" > > ### * symbols.phylog > > flush(stderr()); flush(stdout()) > > ### Name: symbols.phylog > ### Title: Representation of a quantitative variable in front of a > ### phylogenetic tree > ### Aliases: symbols.phylog dotchart.phylog > ### Keywords: hplot > > ### ** Examples > > data(mjrochet) > mjrochet.phy <- newick2phylog(mjrochet$tre) > tab0 <- data.frame(scalewt(log(mjrochet$tab))) > par(mfrow=c(3,2)) > for (j in 1:6) { + w <- tab0[,j] + symbols.phylog(phylog = mjrochet.phy, w, csi = 1.5, cleg = 1.5, + sub = names(tab0)[j], csub = 3) + } > par(mfrow=c(1,1)) > > par(mfrow=c(2,3)) > for (j in 1:6) { + w <- tab0[,j] + dotchart.phylog(mjrochet.phy, w, cdot=1.5, + sub=names(tab0)[j],csub=3,cnodes=2,ceti=1.5) + } > par(mfrow=c(1,1)) > > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "syndicats" > > ### * syndicats > > flush(stderr()); flush(stdout()) > > ### Name: syndicats > ### Title: Two Questions asked on a Sample of 1000 Respondents > ### Aliases: syndicats > ### Keywords: datasets > > ### ** Examples > > data(syndicats) > par(mfrow = c(1,2)) > dudi1 <- dudi.coa(syndicats, scan = FALSE) > score (dudi1, 1, TRUE) > score (dudi1, 1, FALSE) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "t3012" > > ### * t3012 > > flush(stderr()); flush(stdout()) > > ### Name: t3012 > ### Title: Average temperatures of 30 French cities > ### Aliases: t3012 > ### Keywords: datasets > > ### ** Examples > > data(t3012) > data(elec88) > area.plot(elec88$area) > s.arrow(t3012$xy, ori = as.numeric(t3012$xy["Paris",]), + add.p = TRUE) > > > > cleanEx(); ..nameEx <- "table.cont" > > ### * table.cont > > flush(stderr()); flush(stdout()) > > ### Name: table.cont > ### Title: Plot of Contingency Tables > ### Aliases: table.cont > ### Keywords: hplot > > ### ** Examples > > data(chats) > chatsw <- data.frame(t(chats)) > chatscoa <- dudi.coa(chatsw, scann = FALSE) > par(mfrow = c(2,2)) > table.cont(chatsw, abmean.x = TRUE, csi = 2, abline.x = TRUE, + clabel.r = 1.5, clabel.c = 1.5) > table.cont(chatsw, abmean.y = TRUE, csi = 2, abline.y = TRUE, + clabel.r = 1.5, clabel.c = 1.5) > table.cont(chatsw, x = chatscoa$c1[,1], y = chatscoa$l1[,1], + abmean.x = TRUE, csi = 2, abline.x = TRUE, clabel.r = 1.5, clabel.c = 1.5) > table.cont(chatsw, x = chatscoa$c1[,1], y = chatscoa$l1[,1], + abmean.y = TRUE, csi = 2, abline.y = TRUE, clabel.r = 1.5, clabel.c = 1.5) > par(mfrow = c(1,1)) > > ## Not run: > ##D data(rpjdl) > ##D w <- data.frame(t(rpjdl$fau)) > ##D wcoa <- dudi.coa(w, scann = FALSE) > ##D table.cont(w, abmean.y = TRUE, x = wcoa$c1[,1], y = rank(wcoa$l1[,1]), > ##D csi = 0.2, clabel.c = 0, row.labels = rpjdl$lalab, clabel.r = 0.75) > ## End(Not run) > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "table.dist" > > ### * table.dist > > flush(stderr()); flush(stdout()) > > ### Name: table.dist > ### Title: Graph Display for Distance Matrices > ### Aliases: table.dist > ### Keywords: hplot > > ### ** Examples > > data(eurodist) > table.dist(eurodist, labels = attr(eurodist, "Labels")) > > > > cleanEx(); ..nameEx <- "table.paint" > > ### * table.paint > > flush(stderr()); flush(stdout()) > > ### Name: table.paint > ### Title: Plot of the arrays by grey levels > ### Aliases: table.paint > ### Keywords: hplot > > ### ** Examples > > data(rpjdl) > X <- data.frame(t(rpjdl$fau)) > Y <- data.frame(t(rpjdl$mil)) > layout(matrix(c(1,2,2,2,1,2,2,2,1,2,2,2,1,2,2,2), 4, 4)) > coa1 <- dudi.coa(X, scan = FALSE) > x <- rank(coa1$co[,1]) > y <- rank(coa1$li[,1]) > table.paint(Y, x = x, y = 1:8, clabel.c = 0, cleg = 0) > abline(v = 114.9, lwd = 3, col = "red") > abline(v = 66.4, lwd = 3, col = "red") > table.paint(X, x = x, y = y, clabel.c = 0, cleg = 0, + row.lab = paste(" ", row.names(X), sep = "")) > abline(v = 114.9, lwd = 3, col = "red") > abline(v = 66.4, lwd = 3, col = "red") > > > > cleanEx(); ..nameEx <- "table.phylog" > > ### * table.phylog > > flush(stderr()); flush(stdout()) > > ### Name: table.phylog > ### Title: Plot arrays in front of a phylogenetic tree > ### Aliases: table.phylog > ### Keywords: hplot > > ### ** Examples > > data(newick.eg) > w.phy <- newick2phylog(newick.eg[[9]]) > w.tab <- data.frame(matrix(rnorm(620), 31, 20)) > row.names(w.tab) <- sort(names(w.phy$leaves)) > table.phylog(w.tab, w.phy, csi = 1.5, f = 0.5, + clabel.n = 0.75, clabel.c = 0.5) > > > > cleanEx(); ..nameEx <- "table.value" > > ### * table.value > > flush(stderr()); flush(stdout()) > > ### Name: table.value > ### Title: Plot of the Arrays > ### Aliases: table.value table.prepare > ### Keywords: hplot > > ### ** Examples > > data(olympic) > w <- olympic$tab > w <- data.frame(scale(w)) > wpca <- dudi.pca(w, scann = FALSE) > par(mfrow = c(1,3)) > table.value(w, csi = 2, clabel.r = 2, clabel.c = 2) > table.value(w, y = rank(wpca$li[,1]), x = rank(wpca$co[,1]), csi = 2, + clabel.r = 2, clabel.c = 2) > table.value(w, y = wpca$li[,1], x = wpca$co[,1], csi = 2, + clabel.r = 2, clabel.c = 2) > par(mfrow = c(1,1)) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "tarentaise" > > ### * tarentaise > > flush(stderr()); flush(stdout()) > > ### Name: tarentaise > ### Title: Mountain Avifauna > ### Aliases: tarentaise > ### Keywords: datasets > > ### ** Examples > > data(tarentaise) > coa1 <- dudi.coa(tarentaise$ecol, sca = FALSE, nf = 2) > s.class(coa1$li, tarentaise$envir$alti, wt = coa1$lw) > > acm1 <- dudi.acm(tarentaise$envir, sca = FALSE, nf = 2) > s.class(acm1$li, tarentaise$envir$alti) > > > > cleanEx(); ..nameEx <- "taxo.eg" > > ### * taxo.eg > > flush(stderr()); flush(stdout()) > > ### Name: taxo.eg > ### Title: Examples of taxonomy > ### Aliases: taxo.eg > ### Keywords: datasets > > ### ** Examples > > data(taxo.eg) > taxo.eg[[1]] genre famille ordre esp8 g2 fam2 ORD2 esp3 g1 fam1 ORD1 esp1 g1 fam1 ORD1 esp2 g1 fam1 ORD1 esp4 g1 fam1 ORD1 esp14 g8 fam5 ORD2 esp15 g8 fam5 ORD2 esp9 g3 fam2 ORD2 esp13 g7 fam4 ORD2 esp12 g6 fam4 ORD2 esp11 g5 fam3 ORD2 esp10 g4 fam3 ORD2 esp5 g1 fam1 ORD1 esp6 g1 fam1 ORD1 esp7 g1 fam1 ORD1 > as.taxo(taxo.eg[[1]]) genre famille ordre esp3 g1 fam1 ORD1 esp1 g1 fam1 ORD1 esp2 g1 fam1 ORD1 esp4 g1 fam1 ORD1 esp5 g1 fam1 ORD1 esp6 g1 fam1 ORD1 esp7 g1 fam1 ORD1 esp8 g2 fam2 ORD2 esp9 g3 fam2 ORD2 esp10 g4 fam3 ORD2 esp11 g5 fam3 ORD2 esp12 g6 fam4 ORD2 esp13 g7 fam4 ORD2 esp14 g8 fam5 ORD2 esp15 g8 fam5 ORD2 > class(taxo.eg[[1]]) [1] "data.frame" > class(as.taxo(taxo.eg[[1]])) [1] "data.frame" "taxo" > > tax.phy <- taxo2phylog(as.taxo(taxo.eg[[1]])) > plot.phylog(tax.phy,clabel.l=1) > > par(mfrow = c(1,2)) > table.phylog(tax.phy$Bindica,tax.phy) > table.phylog(tax.phy$Bscores,tax.phy) > par(mfrow = c(1,1)) > > radial.phylog(taxo2phylog(as.taxo(taxo.eg[[2]]))) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "tintoodiel" > > ### * tintoodiel > > flush(stderr()); flush(stdout()) > > ### Name: tintoodiel > ### Title: Tinto and Odiel estuary geochemistry > ### Aliases: tintoodiel > ### Keywords: datasets > > ### ** Examples > > data(tintoodiel) > > ## Not run: > ##D if (require(pixmap, quiet = TRUE)){ > ##D estuary.pnm <- read.pnm(system.file("pictures/tintoodiel.pnm", > ##D package = "ade4")) > ##D s.label(tintoodiel$xy,pixmap = estuary.pnm, neig = tintoodiel$neig, > ##D clab = 0, cpoi = 2, cneig = 3, addax = FALSE, cgrid = 0, grid = FALSE) > ##D } > ## End(Not run) > > estuary.pca <- dudi.pca(tintoodiel$tab, scan = FALSE, nf = 4) > if (require(maptools, quiet = TRUE) & require(spdep, quiet = TRUE)) { + estuary.listw <- nb2listw(neig2nb(tintoodiel$neig)) + estuary.pca.ms <- multispati(estuary.pca, estuary.listw, scan = FALSE, + nfposi = 3,nfnega = 2) + summary(estuary.pca.ms) + par(mfrow = c(1,2)) + barplot(estuary.pca$eig) + barplot(estuary.pca.ms$eig) + par(mfrow = c(1,1)) + } Loading required package: foreign Loading required package: tripack Loading required package: SparseM Multivariate Spatial Analysis Call: multispati(dudi = estuary.pca, listw = estuary.listw, scannf = FALSE, nfposi = 3, nfnega = 2) Scores from the first duality diagramm: var cum ratio moran RS1 4.401792 4.401792 0.2751120 0.222781944 RS2 3.133961 7.535753 0.4709846 0.217365304 RS3 1.818129 9.353883 0.5846177 0.004424936 RS4 1.379856 10.733739 0.6708587 -0.209208617 Eigenvalues decomposition: eig var moran CS1 1.5292058 3.707268 0.4124886 CS2 0.6486201 2.415632 0.2685095 CS3 0.4969485 1.126228 0.4412505 CS15 -0.2964507 1.648786 -0.1797994 CS16 -0.4623624 1.365391 -0.3386300 > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "tithonia" > > ### * tithonia > > flush(stderr()); flush(stdout()) > > ### Name: tithonia > ### Title: Phylogeny and quantitative traits of flowers > ### Aliases: tithonia > ### Keywords: datasets > > ### ** Examples > > data(tithonia) > phy <- newick2phylog(tithonia$tre) > tab <- log(tithonia$tab + 1) > table.phylog(scalewt(tab), phy) > gearymoran(phy$Wmat, tab) class: krandtest test number: 14 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 morho1 0.732 0.995 0.007 2 morho2 0.382 0.756 0.246 3 morho3 0.371 0.736 0.266 4 morho4 0.257 0.252 0.75 5 morho5 0.446 0.904 0.098 6 morho6 0.409 0.864 0.138 7 demo7 0.442 0.954 0.048 8 demo8 0.482 0.966 0.036 9 demo9 0.304 0.385 0.617 10 demo10 0.274 0.191 0.811 11 demo11 0.446 0.893 0.109 12 demo12 0.264 0.121 0.881 13 demo13 0.609 0.996 0.006 14 demo14 0.39 0.818 0.184 > gearymoran(phy$Amat, tab) class: krandtest test number: 14 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 morho1 0.538 0.996 0.006 2 morho2 0.1 0.761 0.241 3 morho3 0.07 0.668 0.334 4 morho4 -0.092 0.256 0.746 5 morho5 0.351 0.985 0.017 6 morho6 0.177 0.861 0.141 7 demo7 0.45 0.999 0.003 8 demo8 0.255 0.947 0.055 9 demo9 -0.011 0.487 0.515 10 demo10 -0.097 0.314 0.688 11 demo11 0.27 0.92 0.082 12 demo12 -0.199 0.119 0.883 13 demo13 0.636 1 0.001 14 demo14 0.051 0.658 0.344 > > > > cleanEx(); ..nameEx <- "tortues" > > ### * tortues > > flush(stderr()); flush(stdout()) > > ### Name: tortues > ### Title: Morphological Study of the Painted Turtle > ### Aliases: tortues > ### Keywords: datasets > > ### ** Examples > > data(tortues) > xyz <- as.matrix(tortues[,1:3]) > ref <- -svd(xyz)$u[,1] > pch0 <- c(1,20)[as.numeric(tortues$sex)] > plot(ref, xyz[,1], ylim = c(40,180), pch = pch0) > abline(lm(xyz[,1]~ -1 + ref)) > points(ref,xyz[,2], pch = pch0) > abline(lm(xyz[,2]~ -1 + ref)) > points(ref,xyz[,3], pch = pch0) > abline(lm(xyz[,3]~ -1 + ref)) > > > > cleanEx(); ..nameEx <- "toxicity" > > ### * toxicity > > flush(stderr()); flush(stdout()) > > ### Name: toxicity > ### Title: Homogeneous Table > ### Aliases: toxicity > ### Keywords: datasets > > ### ** Examples > > data(toxicity) > table.paint(toxicity$tab, row.lab = toxicity$species, + col.lab = toxicity$chemicals) > > table.value(toxicity$tab, row.lab = toxicity$species, + col.lab = toxicity$chemicals) > > > > cleanEx(); ..nameEx <- "triangle.class" > > ### * triangle.class > > flush(stderr()); flush(stdout()) > > ### Name: triangle.class > ### Title: Triangular Representation and Groups of points > ### Aliases: triangle.class > ### Keywords: hplot > > ### ** Examples > > data(euro123) > par(mfrow = c(2,2)) > x = rbind.data.frame(euro123$in78, euro123$in86, euro123$in97) > triangle.plot(x) > triangle.class(x, as.factor(rep("G",36)), csta = 0.5, cell = 1) > triangle.class(x, euro123$plan$an) > triangle.class(x, euro123$plan$pays) > triangle.class(x, euro123$plan$an, cell = 1, axesell = TRUE) > triangle.class(x, euro123$plan$an, cell = 0, csta = 0, + col = c("red", "green", "blue"), axesell = TRUE, clab = 2, cpoi = 2) > triangle.class(x, euro123$plan$an, cell = 2, csta = 0.5, + axesell = TRUE, clab = 1.5) > triangle.class(x, euro123$plan$an, cell = 0, csta = 1, scale = FALSE, + draw.line = FALSE, show.posi = FALSE) > > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "triangle.plot" > > ### * triangle.plot > > flush(stderr()); flush(stdout()) > > ### Name: triangle.plot > ### Title: Triangular Plotting > ### Aliases: triangle.plot triangle.biplot triangle.param > ### triangle.posipoint add.position.triangle > ### Keywords: hplot > > ### ** Examples > > data (euro123) > tot <- rbind.data.frame(euro123$in78, euro123$in86, euro123$in97) > row.names(tot) <- paste(row.names(euro123$in78), rep(c(1,2,3), rep(12,3)), + sep = "") > triangle.plot(tot, label = row.names(tot), clab = 1) > > par(mfrow = c(2,2)) > triangle.plot(euro123$in78, clab = 0, cpoi = 2, addmean = TRUE, + show = FALSE) > triangle.plot(euro123$in86, label = row.names(euro123$in78), clab = 0.8) > triangle.biplot(euro123$in78, euro123$in86) > triangle.plot(rbind.data.frame(euro123$in78, euro123$in86), clab = 1, + addaxes = TRUE, sub = "Principal axis", csub = 2, possub = "topright") > > triangle.plot(euro123[[1]], min3 = c(0,0.2,0.3), max3 = c(0.5,0.7,0.8), + clab = 1, label = row.names(euro123[[1]]), addax = TRUE) > triangle.plot(euro123[[2]], min3 = c(0,0.2,0.3), max3 = c(0.5,0.7,0.8), + clab = 1, label = row.names(euro123[[1]]), addax = TRUE) > triangle.plot(euro123[[3]], min3 = c(0,0.2,0.3), max3 = c(0.5,0.7,0.8), + clab = 1, label = row.names(euro123[[1]]), addax = TRUE) > triangle.plot(rbind.data.frame(euro123[[1]], euro123[[2]], euro123[[3]])) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "trichometeo" > > ### * trichometeo > > flush(stderr()); flush(stdout()) > > ### Name: trichometeo > ### Title: Pair of Ecological Data > ### Aliases: trichometeo > ### Keywords: datasets > > ### ** Examples > > data(trichometeo) > faulog <- log(trichometeo$fau + 1) > pca1 <- dudi.pca(trichometeo$meteo, scan = FALSE) > niche1 <- niche(pca1, faulog, scan = FALSE) > s.label(niche1$ls, clab = 0) > s.distri(niche1$ls, faulog, clab = 0.6, add.p = TRUE, + cell = 0, csta = 0.3) > s.arrow(7 * niche1$c1, clab = 1, add.p = TRUE) > > > > cleanEx(); ..nameEx <- "ungulates" > > ### * ungulates > > flush(stderr()); flush(stdout()) > > ### Name: ungulates > ### Title: Phylogeny and quantitative traits of ungulates. > ### Aliases: ungulates > ### Keywords: datasets > > ### ** Examples > > data(ungulates) > ung.phy <- newick2phylog(ungulates$tre) > plot.phylog(ung.phy,clabel.l=1.25,clabel.n=0.75) > ung.x <- log(ungulates$tab[,1]) > ung.y <- log((ungulates$tab[,2]+ungulates$tab[,3])/2) > names(ung.x) <- names(ung.phy$leaves) > names(ung.y) <- names(ung.x) > plot(ung.x,ung.y) > abline(lm(ung.y~ung.x)) > symbols.phylog(ung.phy,ung.x-mean(ung.x)) > dotchart.phylog(ung.phy,ung.x,cle=1.5,cno=1.5,cdot=1) > orthogram(ung.x,ung.phy$Bscores,nrep=9999) class: krandtest test number: 4 permutation number: 9999 test obs P(X<=obs) P(X>=obs) 1 R2Max 0.4703 0.9904 0.0098 2 SkR2k 7.2903 0.1405 0.8597 3 Dmax 0.2474 0.8206 0.1796 4 SCE 0.4154 0.8176 0.1826 > ung.z <- residuals(lm(ung.y~ung.x)) > names(ung.z) <- names(ung.phy$leaves) > dotchart.phylog(ung.phy,ung.z,cle=1.5,cno=1.5,cdot=1,ceti=0.75) > orthogram(ung.z,ung.phy$Bscores,nrep=9999) class: krandtest test number: 4 permutation number: 9999 test obs P(X<=obs) P(X>=obs) 1 R2Max 0.3567 0.7442 0.256 2 SkR2k 5.3205 0.0096 0.9906 3 Dmax 0.4273 0.986 0.0142 4 SCE 1.0475 0.9806 0.0196 > > > > cleanEx(); ..nameEx <- "uniquewt.df" > > ### * uniquewt.df > > flush(stderr()); flush(stdout()) > > ### Name: uniquewt.df > ### Title: Elimination of Duplicated Rows in a Array > ### Aliases: uniquewt.df > ### Keywords: utilities > > ### ** Examples > > data(ecomor) > forsub.r <- uniquewt.df(ecomor$forsub) > attr(forsub.r, "factor") [1] 1 1 1 2 1 3 3 4 4 4 5 5 4 4 6 6 4 5 7 5 4 4 5 8 1 [26] 4 6 6 9 5 1 10 4 4 4 5 5 5 4 4 4 4 4 5 4 3 11 12 13 5 [51] 10 7 4 4 5 5 5 5 4 4 4 7 13 13 13 14 8 7 12 15 5 1 5 5 5 [76] 5 5 5 9 5 12 5 7 16 7 7 8 12 12 12 12 12 12 12 12 17 18 5 5 5 [101] 5 5 4 19 19 5 5 4 5 5 6 2 1 7 2 2 13 13 20 4 14 21 14 21 14 [126] 14 22 22 4 Levels: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 > forsub.r[1,] foliage ground twig bush trunk aerial E033 1 0 0 1 0 0 > ecomor$forsub[126,] #idem foliage ground twig bush trunk aerial E072 0 0 1 0 1 0 > > dudi.pca(ecomor$forsub, scale = FALSE, scann = FALSE)$eig [1] 0.37533941 0.24104252 0.15616250 0.09072903 0.07514625 0.04457409 > # [1] 0.36845 0.24340 0.15855 0.09052 0.07970 0.04490 > w1 <- attr(forsub.r, "len.class") / sum(attr(forsub.r,"len.class")) > dudi.pca(forsub.r, row.w = w1, scale = FALSE, scann = FALSE)$eig [1] 0.37533941 0.24104252 0.15616250 0.09072903 0.07514625 0.04457409 > # [1] 0.36845 0.24340 0.15855 0.09052 0.07970 0.04490 > > > > cleanEx(); ..nameEx <- "variance.phylog" > > ### * variance.phylog > > flush(stderr()); flush(stdout()) > > ### Name: variance.phylog > ### Title: The phylogenetic ANOVA > ### Aliases: variance.phylog > ### Keywords: models > > ### ** Examples > > data(njplot) > njplot.phy <- newick2phylog(njplot$tre) > variance.phylog(njplot.phy,njplot$tauxcg) $lm Call: lm(formula = fmla, data = df) Coefficients: (Intercept) A1 A2 A3 A4 A5 -4.105e-15 2.884e-01 3.291e-01 -1.967e-02 4.661e-02 3.326e-01 A6 A7 A8 A9 A10 A11 9.722e-02 -4.594e-01 5.077e-02 -2.489e-01 3.056e-01 2.126e-01 A12 A13 -1.691e-01 -1.293e-01 $anova Analysis of Variance Table Response: z Df Sum Sq Mean Sq F value Pr(>F) A1 1 2.9935 2.9935 9.2111 0.006080 ** A2 1 3.8986 3.8986 11.9960 0.002209 ** A3 1 0.0139 0.0139 0.0429 0.837899 A4 1 0.0782 0.0782 0.2407 0.628576 A5 1 3.9834 3.9834 12.2569 0.002019 ** A6 1 0.3402 0.3402 1.0469 0.317332 A7 1 7.5986 7.5986 23.3809 7.855e-05 *** A8 1 0.0928 0.0928 0.2855 0.598470 A9 1 2.2304 2.2304 6.8630 0.015646 * A10 1 3.3618 3.3618 10.3442 0.003977 ** A11 1 1.6270 1.6270 5.0064 0.035705 * A12 1 1.0293 1.0293 3.1673 0.088946 . A13 1 0.6023 0.6023 1.8532 0.187190 Residuals 22 7.1498 0.3250 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 $sumry Df Sum Sq Mean Sq F value Pr(>F) Phylogenetic 13 27.85018 2.14232 6.59193 6e-05 Residuals 22 7.14982 0.32499 > par(mfrow = c(1,2)) > table.phylog(njplot.phy$Ascores, njplot.phy, clabel.row = 0, + clabel.col = 0.1, clabel.nod = 0.6, csize = 1) > dotchart.phylog(njplot.phy, njplot$tauxcg, clabel.nodes = 0.6) > orthogram(njplot$tauxcg, njplot.phy$Ascores) class: krandtest test number: 4 permutation number: 999 test obs P(X<=obs) P(X>=obs) 1 R2Max 0.217 0.846 0.156 2 SkR2k 10.129 0.001 1 3 Dmax 0.436 1 0.001 4 SCE 2.414 1 0.001 > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "veuvage" > > ### * veuvage > > flush(stderr()); flush(stdout()) > > ### Name: veuvage > ### Title: Example for Centring in PCA > ### Aliases: veuvage > ### Keywords: datasets > > ### ** Examples > > data(veuvage) > par(mfrow = c(3,2)) > for (j in 1:6) plot(veuvage$age, veuvage$tab[,j], + xlab = "âge", ylab = "pourcentage de veufs", + type = "b", main = names(veuvage$tab)[j]) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "westafrica" > > ### * westafrica > > flush(stderr()); flush(stdout()) > > ### Name: westafrica > ### Title: Freshwater fish zoogeography in west Africa > ### Aliases: westafrica > ### Keywords: datasets > > ### ** Examples > > data(westafrica) > > s.label(westafrica$cadre, xlim = c(30,500), ylim = c(50,290), + cpoi = 0, clab = 0, grid = FALSE, addax = 0) > old.par <- par(no.readonly = TRUE) > par(mar = c(0.1, 0.1, 0.1, 0.1)) > rect(30,0,500,290) > polygon(westafrica$atlantic,col = "lightblue") > points(westafrica$riv.xy, pch = 20, cex = 1.5) > apply(westafrica$lines, 1, function(x) segments(x[1], x[2], x[3], + x[4], lwd = 1)) NULL > apply(westafrica$riv.xy,1, function(x) segments(x[1], x[2], x[3], + x[4], lwd = 1)) NULL > text(c(175,260,460,420), c(275,200,250,100), c("Senegal","Niger", + "Niger","Volta")) > par(srt = 270) > text(westafrica$riv.xy$x2, westafrica$riv.xy$y2-10, + westafrica$riv.names, adj = 0, cex = 0.75) > par(old.par) > rm(old.par) > > # multivariate analysis > afri.w <- data.frame(t(westafrica$tab)) > afri.dist <- dist.binary(afri.w,1) > afri.pco <- dudi.pco(afri.dist, scan = FALSE, nf = 3) > par(mfrow = c(3,1)) > barplot(afri.pco$li[,1]) > barplot(afri.pco$li[,2]) > barplot(afri.pco$li[,3]) > > if (require(spdep, quiet = TRUE)){ + #multivariate spatial analysis + afri.neig <- neig(n.line = 33) + afri.nb <- neig2nb(afri.neig) + afri.listw <- nb2listw(afri.nb) + afri.ms <- multispati(afri.pco, afri.listw, scan = FALSE, + nfposi = 6, nfnega = 0) + par(mfrow = c(3,1)) + barplot(afri.ms$li[,1]) + barplot(afri.ms$li[,2]) + barplot(afri.ms$li[,3]) + + par(mfrow = c(2,2)) + s.label(afri.ms$li, clab = 0.75, cpoi = 0, neig = afri.neig, + cneig = 1.5) + s.value(afri.ms$li, afri.ms$li[,3]) + s.value(afri.ms$li, afri.ms$li[,4]) + s.value(afri.ms$li, afri.ms$li[,5]) + summary(afri.ms) + } Loading required package: tripack Loading required package: maptools Loading required package: foreign Loading required package: SparseM Multivariate Spatial Analysis Call: multispati(dudi = afri.pco, listw = afri.listw, scannf = FALSE, nfposi = 6, nfnega = 0) Scores from the first duality diagramm: var cum ratio moran RS1 0.05660710 0.05660710 0.1635437 0.9598444 RS2 0.03641095 0.09301805 0.2687386 0.7372155 RS3 0.02776793 0.12078598 0.3489629 0.6735561 Eigenvalues decomposition: eig var moran CS1 0.05455534 0.05641792 0.9669861 CS2 0.03084339 0.03406832 0.9053395 CS3 0.02052642 0.02544985 0.8065439 CS4 0.01671907 0.01891409 0.8839480 CS5 0.01342381 0.01539323 0.8720593 CS6 0.01043363 0.01371212 0.7609053 > > par(mfrow = c(1,1)) > plot(hclust(afri.dist,"ward"),h=-0.2) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "within" > > ### * within > > flush(stderr()); flush(stdout()) > > ### Name: within > ### Title: Within Analyses > ### Aliases: within print.within plot.within > ### Keywords: multivariate > > ### ** Examples > > data(meaudret) > par(mfrow = c(2,2)) > pca1 <- dudi.pca(meaudret$mil, scan = FALSE, nf = 4) > s.traject(pca1$li, meaudret$plan$sta, + sub = "Principal Component Analysis", csub = 1.5) > wit1 <- within(pca1, meaudret$plan$sta, scan = FALSE, nf = 2) > s.traject(wit1$li, meaudret$plan$sta, + sub = "Within site Principal Component Analysis", csub = 1.5) > s.corcircle (wit1$as) > par(mfrow = c(1,1)) > plot(wit1) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "within.pca" > > ### * within.pca > > flush(stderr()); flush(stdout()) > > ### Name: within.pca > ### Title: Normed within Principal Component Analysis > ### Aliases: within.pca > ### Keywords: multivariate > > ### ** Examples > > data(meaudret) > wit1 <- within.pca(meaudret$mil, meaudret$plan$dat, + scan = FALSE, scal = "partial") > kta1 <- ktab.within(wit1, colnames = rep(c("S1","S2","S3","S4","S5"), 4)) > unclass(kta1) $spring S1 S2 S3 S4 S5 Temp -1.372813e+00 -0.3922323 -0.39223227 0.5883484 1.5689291 Debit -1.615156e+00 -0.4251482 -0.01830782 0.8157149 1.2428973 pH 2.041241e-01 -1.8371173 0.20412415 1.2247449 0.2041241 Condu 2.364459e-17 1.9069252 -0.47673129 -0.4767313 -0.9534626 Dbo5 -9.621078e-01 1.9351487 -0.41545565 -0.3061252 -0.2514600 Oxyd -6.364382e-01 1.9923283 -0.49808208 -0.4980821 -0.3597259 Ammo -7.376580e-01 1.9837018 -0.45854414 -0.4087024 -0.3787973 Nitra -5.281643e-01 -1.6155614 0.40389035 0.4038903 1.3359450 Phos -1.047323e+00 1.6189391 -1.06650488 0.1419449 0.3529441 $summer S1 S2 S3 S4 S5 Temp -1.1666667 -1.1666667 0.5000000 1.33333333 0.5000000 Debit -1.2683846 -0.7763389 -0.2296214 0.86381368 1.4105312 pH 0.9354143 -1.4031215 -0.7349684 -0.06681531 1.2694909 Condu -1.5297323 0.9448347 1.1697953 0.04499213 -0.6298898 Dbo5 -1.0875080 1.4231586 0.6175971 0.21481639 -1.1680641 Oxyd -0.7664063 1.9508524 -0.2786932 -0.20901990 -0.6967330 Ammo -1.1379075 1.3255250 0.8424990 0.07982640 -1.1099429 Nitra -0.8553618 -1.4868370 0.4936988 0.69462267 1.1538773 Phos -1.6393299 0.6112322 1.1546918 0.48335936 -0.6099535 $autumn S1 S2 S3 S4 S5 Temp -1.6035675 1.06904497 -0.26726124 1.06904497 -0.2672612 Debit -1.8766905 -0.08487545 0.66957300 0.95249116 0.3395018 pH 0.5619515 -1.31122014 -0.84292723 0.09365858 1.4985373 Condu -0.7012869 1.87009833 0.11688115 -0.35064344 -0.9350492 Dbo5 -0.6044785 1.97542987 -0.19199318 -0.57447961 -0.6044785 Oxyd -0.7363901 1.97092649 -0.23102435 -0.41151212 -0.5919999 Ammo -0.6470895 1.95761335 -0.09597377 -0.57374709 -0.6408030 Nitra -0.5674453 -1.62198962 1.13991221 0.83861383 0.2109089 Phos -1.1374069 1.70830946 0.47677844 -0.44686983 -0.6008112 $winter S1 S2 S3 S4 S5 Temp 0.5000000 0.5000000 0.500000000 0.5000000 -2.0000000 Debit -1.5362076 -0.4891485 0.003125549 1.4330644 0.5891661 pH -1.8864844 0.6859943 0.685994341 0.6859943 -0.1714986 Condu -0.9819805 0.9274260 1.472970759 -0.7092081 -0.7092081 Dbo5 -1.0927369 1.2659029 1.027053299 -0.1373385 -1.0628807 Oxyd -0.9763927 1.2666716 1.134726600 -0.4486128 -0.9763927 Ammo -1.1833898 1.0449484 1.310452499 -0.3584306 -0.8135805 Nitra -1.9709202 0.4077766 0.577683516 0.2378697 0.7475904 Phos -1.0886790 0.4133145 1.744869109 -0.4175755 -0.6519291 $lw [1] 1 1 1 1 1 1 1 1 1 $cw [1] 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 [20] 0.2 $blo spring summer autumn winter 5 5 5 5 $TL T L 1 1 1 2 1 2 3 1 3 4 1 4 5 1 5 6 1 6 7 1 7 8 1 8 9 1 9 10 2 1 11 2 2 12 2 3 13 2 4 14 2 5 15 2 6 16 2 7 17 2 8 18 2 9 19 3 1 20 3 2 21 3 3 22 3 4 23 3 5 24 3 6 25 3 7 26 3 8 27 3 9 28 4 1 29 4 2 30 4 3 31 4 4 32 4 5 33 4 6 34 4 7 35 4 8 36 4 9 $TC T C 1 1 1 2 1 2 3 1 3 4 1 4 5 1 5 6 2 1 7 2 2 8 2 3 9 2 4 10 2 5 11 3 1 12 3 2 13 3 3 14 3 4 15 3 5 16 4 1 17 4 2 18 4 3 19 4 4 20 4 5 $T4 T 4 1 1 1 2 1 2 3 1 3 4 1 4 5 2 1 6 2 2 7 2 3 8 2 4 9 3 1 10 3 2 11 3 3 12 3 4 13 4 1 14 4 2 15 4 3 16 4 4 $call ktab.within(dudiwit = wit1, colnames = rep(c("S1", "S2", "S3", "S4", "S5"), 4)) $tabw autumn spring summer winter 0.25 0.25 0.25 0.25 > # See pta > plot(wit1) > > > > cleanEx(); ..nameEx <- "witwit.coa" > > ### * witwit.coa > > flush(stderr()); flush(stdout()) > > ### Name: witwit.coa > ### Title: Internal Correspondence Analysis > ### Aliases: witwit.coa summary.witwit > ### Keywords: multivariate > > ### ** Examples > > data(ardeche) > coa1 <- dudi.coa(ardeche$tab, scann = FALSE, nf = 4) > ww <- witwit.coa(coa1, ardeche$row.blocks, ardeche$col.blocks, scann = FALSE) > ww Duality diagramm class: witwit coa dudi $call: witwit.coa(dudi = coa1, row.blocks = ardeche$row.blocks, col.blocks = ardeche$col.blocks, scannf = FALSE) $nf: 2 axis-components saved $rank: 31 eigen values: 0.06858 0.06325 0.04253 0.03564 0.02911 ... vector length mode content 1 $cw 35 numeric column weights 2 $lw 43 numeric row weights 3 $eig 31 numeric eigen values data.frame nrow ncol content 1 $tab 43 35 modified array 2 $li 43 2 row coordinates 3 $l1 43 2 row normed scores 4 $co 35 2 column coordinates 5 $c1 35 2 column normed scores other elements: lbvar lbw cbvar cbw > s.class(ww$co, ardeche$sta.fac, clab = 1.5, cell = 0, axesell = FALSE) > s.label(ww$co, add.p = TRUE, clab = 0.75) > summary(ww) Internal correspondence analysis class: witwit coa dudi $call: witwit.coa(dudi = coa1, row.blocks = ardeche$row.blocks, col.blocks = ardeche$col.blocks, scannf = FALSE) 2 axis-components saved eigen values: 0.06858 0.06325 0.04253 0.03564 0.02911 ... Eigen value decomposition among row blocks Axis1 Axis2 weights Eph 0.0511 0.0563 0.2879 Ple 0.1154 0.0263 0.0653 Col 0.0204 0.0709 0.3703 Tri 0.1403 0.069 0.2766 mean 0.0686 0.0632 Axis1 Axis2 Eph 215 256 Ple 110 27 Col 110 415 Tri 566 302 sum 1000 1000 Eigen value decomposition among column blocks Comp1 Comp2 weights jul82 0.0109 0.0706 0.1859 aug82 0.0414 0.1063 0.1797 nov82 0.017 7e-04 0.1054 feb83 0.1915 0.0321 0.1364 apr83 0.1384 0.0614 0.1895 jul83 0.0244 0.0736 0.2031 mean 0.0686 0.0632 Comp1 Comp2 jul82 30 207 aug82 108 302 nov82 26 1 feb83 381 69 apr83 383 184 jul83 72 236 sum 1000 1000 > > > > cleanEx(); ..nameEx <- "worksurv" > > ### * worksurv > > flush(stderr()); flush(stdout()) > > ### Name: worksurv > ### Title: French Worker Survey (1970) > ### Aliases: worksurv > ### Keywords: datasets > > ### ** Examples > > data(worksurv) > acm1 <- dudi.acm(worksurv, row.w = attr(worksurv,"counts"), + scan = FALSE) > par(mfrow = c(2,2)) > apply(worksurv,2, function(x) s.class(acm1$li, factor(x), + attr(worksurv, 'counts'))) NULL > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "yanomama" > > ### * yanomama > > flush(stderr()); flush(stdout()) > > ### Name: yanomama > ### Title: Distance Matrices > ### Aliases: yanomama > ### Keywords: datasets > > ### ** Examples > > data(yanomama) > gen <- quasieuclid(as.dist(yanomama$gen)) # depends of mva > ant <- quasieuclid(as.dist(yanomama$ant)) # depends of mva > par(mfrow = c(2,2)) > plot(gen, ant) > t1 <- mantel.randtest(gen, ant, 99); > plot(t1, main = "gen-ant-mantel") ; print(t1) Monte-Carlo test Observation: 0.2999879 Call: mantel.randtest(m1 = gen, m2 = ant, nrepet = 99) Based on 99 replicates Simulated p-value: 0.05 > t1 <- procuste.rtest(pcoscaled(gen), pcoscaled(ant), 99) > plot(t1, main = "gen-ant-procuste") ; print(t1) Monte-Carlo test Observation: 0.6819023 Call: procuste.rtest(df1 = pcoscaled(gen), df2 = pcoscaled(ant), nrepet = 99) Based on 99 replicates Simulated p-value: 0.01 > t1 <- RV.rtest(pcoscaled(gen), pcoscaled(ant), 99) > plot(t1, main = "gen-ant-RV") ; print(t1) Monte-Carlo test Observation: 0.4272698 Call: RV.rtest(df1 = pcoscaled(gen), df2 = pcoscaled(ant), nrepet = 99) Based on 99 replicates Simulated p-value: 0.03 > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "zealand" > > ### * zealand > > flush(stderr()); flush(stdout()) > > ### Name: zealand > ### Title: Road distances in New-Zealand > ### Aliases: zealand > ### Keywords: datasets > > ### ** Examples > > data(zealand) > > d0 = mat2dist(as.matrix(zealand$road)) > d1 = cailliez (d0) > d2 = lingoes(d0) > s.label(zealand$xy,lab=as.character(1:13),neig=zealand$neig) > par(mfrow = c(2,2)) > s.label(cmdscale(dist(zealand$xy)),lab = as.character(1:13), + neig = zealand$neig, sub = "Distance canonique", csub = 2) > s.label(cmdscale(d0), lab = as.character(1:13), neig = zealand$neig, + sub = "Distance routière", csub = 2) > s.label(cmdscale(d1), lab = as.character(1:13), neig = zealand$neig, + sub = "Distance routière / Cailliez", csub = 2) > s.label(cmdscale(d2), lab = as.character(1:13), neig = zealand$neig, + sub = "Distance routière / Lingoës", csub = 2) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > ### *