[adegenet-commits] r929 - pkg/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 27 18:22:35 CEST 2011


Author: jombart
Date: 2011-06-27 18:22:35 +0200 (Mon, 27 Jun 2011)
New Revision: 929

Modified:
   pkg/man/SNPbin.Rd
   pkg/man/dapc.Rd
   pkg/man/export.Rd
   pkg/man/fstat.Rd
   pkg/man/genind.Rd
   pkg/man/genlight.Rd
   pkg/man/glPca.Rd
   pkg/man/glSim.Rd
   pkg/man/gstat.randtest.Rd
   pkg/man/nancycats.Rd
Log:
Made a few examples less RAM-demanding, \dontrun lots of stuffs.


Modified: pkg/man/SNPbin.Rd
===================================================================
--- pkg/man/SNPbin.Rd	2011-06-27 11:37:21 UTC (rev 928)
+++ pkg/man/SNPbin.Rd	2011-06-27 16:22:35 UTC (rev 929)
@@ -114,8 +114,8 @@
 }
 \examples{
 #### HAPLOID EXAMPLE ####
-## create a genotype of 1,000,000 SNPs
-dat <- sample(c(0,1,NA), 1e6, prob=c(.495, .495, .01), replace=TRUE)
+## create a genotype of 100,000 SNPs
+dat <- sample(c(0,1,NA), 1e5, prob=c(.495, .495, .01), replace=TRUE)
 dat[1:10]
 x <- new("SNPbin", dat)
 x
@@ -137,8 +137,8 @@
 
 
 #### TETRAPLOID EXAMPLE ####
-## create a genotype of 1,000,000 SNPs
-dat <- sample(c(0:4,NA), 1e6, prob=c(rep(.995/5,5), 0.005), replace=TRUE)
+## create a genotype of 100,000 SNPs
+dat <- sample(c(0:4,NA), 1e5, prob=c(rep(.995/5,5), 0.005), replace=TRUE)
 x <- new("SNPbin", dat)
 identical(as(x, "integer"),as.integer(dat)) # MUST BE TRUE
 

Modified: pkg/man/dapc.Rd
===================================================================
--- pkg/man/dapc.Rd	2011-06-27 11:37:21 UTC (rev 928)
+++ pkg/man/dapc.Rd	2011-06-27 16:22:35 UTC (rev 929)
@@ -223,8 +223,6 @@
 lab=paste("year\n",2001:2006), axesel=FALSE, col=terrain.colors(10))
 
 
-
-
 ## SHOW COMPOPLOT ON MICROBOV DATA ##
 data(microbov)
 dapc1 <- dapc(microbov, n.pca=20, n.da=15)
@@ -233,6 +231,7 @@
 
 
 
+\dontrun{
 ## EXAMPLE USING GENLIGHT OBJECTS ##
 ## simulate data
 x <- glSim(50,4e3-50, 50, ploidy=2)
@@ -252,7 +251,6 @@
 
 
 
-\dontrun{
 ## USE "PREDICT" TO PREDICT GROUPS OF NEW INDIVIDUALS ##
 ## load data
 data(sim2pop)

Modified: pkg/man/export.Rd
===================================================================
--- pkg/man/export.Rd	2011-06-27 11:37:21 UTC (rev 928)
+++ pkg/man/export.Rd	2011-06-27 16:22:35 UTC (rev 929)
@@ -49,18 +49,19 @@
 }
 \seealso{\code{\link{import2genind}}}
 \author{Thibaut Jombart \email{t.jombart at imperial.ac.uk} }
-% \examples{
-% if(require(hierfstat)){
+\examples{
+\dontrun{
+if(require(hierfstat) & require(genetics)){
 
-% obj <- read.fstat(system.file("data/diploid.dat",package="hierfstat"))
+obj <- read.fstat(system.file("data/diploid.dat",package="hierfstat"))
 
-% X <- genind2hierfstat(obj)
-% X
+X <- genind2hierfstat(obj)
+X
 
-% read.fstat.data(paste(.path.package("hierfstat"),"/data/diploid.dat",sep="",collapse=""),nloc=5)
-% }
-% if(require(genetics)){
-% genind2genotype(obj)
-% }
-% }
+read.fstat.data(paste(.path.package("hierfstat"),"/data/diploid.dat",sep="",collapse=""),nloc=5)
+
+genind2genotype(obj)
+}
+}
+}
 \keyword{manip}
\ No newline at end of file

Modified: pkg/man/fstat.Rd
===================================================================
--- pkg/man/fstat.Rd	2011-06-27 11:37:21 UTC (rev 928)
+++ pkg/man/fstat.Rd	2011-06-27 16:22:35 UTC (rev 929)
@@ -55,16 +55,20 @@
  \eqn{  Fst(A,B) = \frac{(Ht - (n_A Hs(A) + n_B Hs(B))/(n_A + n_B) )}{Ht}} \cr
 }
 \author{ Thibaut Jombart \email{t.jombart at imperial.ac.uk} }
-% \examples{
-% if(require(hierfstat)){
-% data(nancycats)
+\examples{
+\dontrun{
+## pairwise Fst
+mat.fst <- pairwise.fst(nancycats, res.type="matrix")
+mat.fst
 
-% ## Fst, Fis, Fit
-% fstat(nancycats)
 
-% ## pairwise Fst
-% mat.fst <- pairwise.fst(nancycats, res.type="matrix")
-% mat.fst
-% }
-% }
+## using hierfstat (if available)
+if(require(hierfstat)){
+data(nancycats)
+
+## Fst, Fis, Fit
+fstat(nancycats)
+}
+}
+}
 \keyword{multivariate}
\ No newline at end of file

Modified: pkg/man/genind.Rd
===================================================================
--- pkg/man/genind.Rd	2011-06-27 11:37:21 UTC (rev 928)
+++ pkg/man/genind.Rd	2011-06-27 16:22:35 UTC (rev 929)
@@ -79,14 +79,16 @@
 validObject(obj)
 summary(obj)
 
+\dontrun{
 # test inter-colonies structuration
 if(require(hierfstat)){
 gtest <- gstat.randtest(obj,nsim=99)
 gtest
 plot(gtest)
 }
+}
 
-# perform an inter-class PCA
+# perform a between-class PCA
 if(require(ade4)){
 pca1 <- dudi.pca(obj at tab,scannf=FALSE,scale=FALSE)
 pcabet1 <- between(pca1,obj at pop,scannf=FALSE)

Modified: pkg/man/genlight.Rd
===================================================================
--- pkg/man/genlight.Rd	2011-06-27 11:37:21 UTC (rev 928)
+++ pkg/man/genlight.Rd	2011-06-27 16:22:35 UTC (rev 929)
@@ -284,6 +284,7 @@
 as.list(x[c(TRUE,FALSE), c(TRUE,TRUE,FALSE,FALSE)])
 
 
+\dontrun{
 ## REAL-SIZE EXAMPLE ##
 ## 50 genotypes of 1,000,000 SNPs
 dat <- lapply(1:50, function(i) sample(c(0,1,NA), 1e6, prob=c(.5, .49, .01), replace=TRUE))
@@ -294,6 +295,7 @@
 x
 print(object.size(x), unit="au") # size of the genlight object
 object.size(dat)/object.size(x) # conversion efficiency
+}
 
 
 #### cbind, rbind ####

Modified: pkg/man/glPca.Rd
===================================================================
--- pkg/man/glPca.Rd	2011-06-27 11:37:21 UTC (rev 928)
+++ pkg/man/glPca.Rd	2011-06-27 16:22:35 UTC (rev 929)
@@ -167,6 +167,7 @@
 }
 \author{ Thibaut Jombart \email{t.jombart at imperial.ac.uk} }
 \examples{
+\dontrun{
 ## simulate a toy dataset
 x <- glSim(50,4e3, 50, ploidy=2)
 x
@@ -185,4 +186,5 @@
 s.class(pca1$scores, pop(x), col=colors()[c(131,134)])
 add.scatter.eig(pca1$eig,2,1,2)
 }
+}
 \keyword{multivariate}
\ No newline at end of file

Modified: pkg/man/glSim.Rd
===================================================================
--- pkg/man/glSim.Rd	2011-06-27 11:37:21 UTC (rev 928)
+++ pkg/man/glSim.Rd	2011-06-27 16:22:35 UTC (rev 929)
@@ -106,7 +106,7 @@
 plot(x)
 
 ##  same thing, loci with LD structures
-x <- glSim(100, 1, n.snp.struc=100, ploid=2, alpha=0.4, LD=TRUE, block.size=100)
+x <- glSim(100, 1e3, n.snp.struc=100, ploid=2, alpha=0.4, LD=TRUE, block.size=100)
 plot(x)
 
 }

Modified: pkg/man/gstat.randtest.Rd
===================================================================
--- pkg/man/gstat.randtest.Rd	2011-06-27 11:37:21 UTC (rev 928)
+++ pkg/man/gstat.randtest.Rd	2011-06-27 16:22:35 UTC (rev 929)
@@ -51,6 +51,7 @@
 }
 \author{ Thibaut Jombart \email{t.jombart at imperial.ac.uk} }
 \examples{
+\dontrun{
 if(require(hierfstat)){
 # here the example of g.stats.glob is taken using gstat.randtest
 data(gtrunchier)
@@ -72,5 +73,6 @@
 gstat.randtest(x,nsim=99,pop=gtrunchier$Locality,method="between",sub.pop=gtrunchier$Patch)
 }
 }
+}
 \keyword{manip}
 \keyword{multivariate}
\ No newline at end of file

Modified: pkg/man/nancycats.Rd
===================================================================
--- pkg/man/nancycats.Rd	2011-06-27 11:37:21 UTC (rev 928)
+++ pkg/man/nancycats.Rd	2011-06-27 16:22:35 UTC (rev 929)
@@ -24,6 +24,7 @@
   habitat using: not all colonies are equal. submitted to \emph{Molecular Ecology}
 }
 \examples{
+\dontrun{
 data(nancycats)
 nancycats
 
@@ -55,4 +56,5 @@
 Fstat
 }
 }
+}
 \keyword{datasets}



More information about the adegenet-commits mailing list