[adegenet-commits] r1009 - in pkg: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 12 11:07:33 CEST 2012


Author: jombart
Date: 2012-06-12 11:07:33 +0200 (Tue, 12 Jun 2012)
New Revision: 1009

Modified:
   pkg/DESCRIPTION
   pkg/R/auxil.R
   pkg/R/chooseCN.R
   pkg/R/dapc.R
   pkg/R/find.clust.R
   pkg/R/glFunctions.R
   pkg/R/glPlot.R
   pkg/R/handling.R
   pkg/R/import.R
   pkg/R/loadingplot.R
   pkg/R/monmonier.R
   pkg/R/spca.R
   pkg/man/auxil.Rd
Log:
changes made in Lyon to pass the check without notes; still not finished


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/DESCRIPTION	2012-06-12 09:07:33 UTC (rev 1009)
@@ -1,5 +1,5 @@
 Package: adegenet
-Version: 1.3-4
+Version: 1.3-5
 Date: 2011/12/22
 Title: adegenet: an R package for the exploratory analysis of genetic and genomic data.
 Author:  Thibaut Jombart <t.jombart at imperial.ac.uk>

Modified: pkg/R/auxil.R
===================================================================
--- pkg/R/auxil.R	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/R/auxil.R	2012-06-12 09:07:33 UTC (rev 1009)
@@ -263,12 +263,3 @@
 ## psychedelic
 funky <- colorRampPalette(c("grey30","blue","green3","gold","orange","red","brown4","purple"))
 
-
-
-##
-## example:
-##
-## x <- c(rnorm(10), rnorm(15,3), rnorm(5,10))
-## f <- rep(letters[1:3], c(10,15,5))
-## 
-##

Modified: pkg/R/chooseCN.R
===================================================================
--- pkg/R/chooseCN.R	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/R/chooseCN.R	2012-06-12 09:07:33 UTC (rev 1009)
@@ -10,7 +10,7 @@
   result.type <- tolower(result.type)
    if(is.null(type) & !ask) stop("Non-interactive mode but no graph chosen; please provide a value for 'type' argument.")
 
-  if(!require(spdep, quiet=TRUE)) stop("spdep library is required.")
+  if(!require(spdep, quietly=TRUE)) stop("spdep library is required.")
 
   res <- list()
 
@@ -92,7 +92,7 @@
     ## graph types
     ## type 1: Delaunay
     if(type==1){
-      if(!require(tripack, quiet=TRUE)) stop("tripack library is required.")
+      if(!require(tripack, quietly=TRUE)) stop("tripack library is required.")
       cn <- tri2nb(xy)
     }
 
@@ -110,7 +110,7 @@
 
     ## type 4: Minimum spanning tree
     if(type==4){
-      if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
+      if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
       cn <- ade4::mstree(dist(xy)) # there is also a spdep::mstree
       cn <- neig2nb(cn)
     }

Modified: pkg/R/dapc.R
===================================================================
--- pkg/R/dapc.R	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/R/dapc.R	2012-06-12 09:07:33 UTC (rev 1009)
@@ -11,8 +11,8 @@
                             pca.select=c("nbEig","percVar"), perc.pca=NULL, ..., dudi=NULL){
 
     ## FIRST CHECKS
-    if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
-    if(!require(MASS, quiet=TRUE)) stop("MASS library is required.")
+    if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
+    if(!require(MASS, quietly=TRUE)) stop("MASS library is required.")
     grp <- as.factor(grp)
     if(length(grp) != nrow(x)) stop("Inconsistent length for grp")
     pca.select <- match.arg(pca.select)
@@ -156,8 +156,8 @@
                         pca.select=c("nbEig","percVar"), perc.pca=NULL, ...){
 
     ## FIRST CHECKS
-    if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
-    if(!require(MASS, quiet=TRUE)) stop("MASS library is required.")
+    if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
+    if(!require(MASS, quietly=TRUE)) stop("MASS library is required.")
 
     if(!is.genind(x)) stop("x must be a genind object.")
 
@@ -219,8 +219,8 @@
                           scale=FALSE,  var.contrib=TRUE, pca.info=TRUE,
                           pca.select=c("nbEig","percVar"), perc.pca=NULL, glPca=NULL, ...){
     ## FIRST CHECKS ##
-    if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
-    if(!require(MASS, quiet=TRUE)) stop("MASS library is required.")
+    if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
+    if(!require(MASS, quietly=TRUE)) stop("MASS library is required.")
     if(!inherits(x, "genlight")) stop("x must be a genlight object.")
 
     pca.select <- match.arg(pca.select)
@@ -457,7 +457,7 @@
 ## summary.dapc
 ##############
 summary.dapc <- function(object, ...){
-    if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
+    if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
 
     x <- object
     res <- list()
@@ -494,7 +494,7 @@
                          cstar = 1, cellipse = 1.5, axesell = FALSE, label = levels(grp), clabel = 1, xlim = NULL, ylim = NULL,
                          grid = FALSE, addaxes = TRUE, origin = c(0,0), include.origin = TRUE, sub = "", csub = 1, possub = "bottomleft",
                          cgrid = 1, pixmap = NULL, contour = NULL, area = NULL, ...){
-    if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
+    if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
     ONEDIM <- xax==yax | ncol(x$ind.coord)==1
 
     ## recycle color and pch
@@ -595,7 +595,7 @@
             box()
         }
 
-        add.scatter(inset(), posi=posi.da, ratio=ratio.da, bg=bg.inset, inset=inset.da)
+        add.scatter(inset(), posi=posi.da, ratio=ratio.da, bg.col=bg.inset, inset=inset.da)
         ##add.scatter.eig(x$eig, ncol(x$loadings), axes[1], axes[2], posi=posi, ratio=ratio, csub=csub) # does not allow for bg
     }
 
@@ -609,7 +609,7 @@
                  type="h", xaxt="n", yaxt="n", xlab="", ylab="", lwd=2)
             mtext(side=3, "PCA eigenvalues", line=-1.2, adj=.1)
         }
-        add.scatter(inset(), posi=posi.pca, ratio=ratio.pca, bg=bg.inset, inset=inset.pca)
+        add.scatter(inset(), posi=posi.pca, ratio=ratio.pca, bg.col=bg.inset, inset=inset.pca)
     }
 
 
@@ -625,7 +625,7 @@
 ## assignplot
 ############
 assignplot <- function(x, only.grp=NULL, subset=NULL, new.pred=NULL, cex.lab=.75, pch=3){
-    if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
+    if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
     if(!inherits(x, "dapc")) stop("x is not a dapc object")
 
     ## handle data from predict.dapc ##
@@ -662,8 +662,8 @@
     Z <- Z[,ncol(Z):1,drop=FALSE ]
 
     image(x=1:n.grp, y=seq(.5, by=1, le=n.ind), Z, col=rev(heat.colors(100)), yaxt="n", ylab="", xaxt="n", xlab="Clusters")
-    axis(side=1, at=1:n.grp,tick=FALSE, label=colnames(x$posterior))
-    axis(side=2, at=seq(.5, by=1, le=n.ind), label=rev(rownames(x$posterior)), las=1, cex.axis=cex.lab)
+    axis(side=1, at=1:n.grp,tick=FALSE, labels=colnames(x$posterior))
+    axis(side=2, at=seq(.5, by=1, le=n.ind), labels=rev(rownames(x$posterior)), las=1, cex.axis=cex.lab)
     abline(h=1:n.ind, col="lightgrey")
     abline(v=seq(0.5, by=1, le=n.grp))
     box()
@@ -686,7 +686,7 @@
 ############
 compoplot <- function(x, only.grp=NULL, subset=NULL, new.pred=NULL, col=NULL, lab=NULL,
                       legend=TRUE, txt.leg=NULL, ncol=4, posi=NULL, cleg=.8, bg=transp("white"), ...){
-    if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
+    if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
     if(!inherits(x, "dapc")) stop("x is not a dapc object")
 
 

Modified: pkg/R/find.clust.R
===================================================================
--- pkg/R/find.clust.R	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/R/find.clust.R	2012-06-12 09:07:33 UTC (rev 1009)
@@ -12,8 +12,8 @@
                                      pca.select=c("nbEig","percVar"), perc.pca=NULL,..., dudi=NULL){
 
     ## CHECKS ##
-    if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
-    if(!require(MASS, quiet=TRUE)) stop("MASS library is required.")
+    if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
+    if(!require(MASS, quietly=TRUE)) stop("MASS library is required.")
     if(!require(stats)) stop("package stats is required")
 
     stat <- match.arg(stat)
@@ -196,8 +196,8 @@
                           scale=FALSE, scale.method=c("sigma", "binom"), truenames=TRUE, ...){
 
     ## CHECKS ##
-    if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
-    if(!require(MASS, quiet=TRUE)) stop("MASS library is required.")
+    if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
+    if(!require(MASS, quietly=TRUE)) stop("MASS library is required.")
     if(!require(stats)) stop("package stats is required")
     if(!is.genind(x)) stop("x must be a genind object.")
     stat <- match.arg(stat)
@@ -246,8 +246,8 @@
                                    scale=FALSE, pca.select=c("nbEig","percVar"), perc.pca=NULL, glPca=NULL, ...){
 
     ## CHECKS ##
-    if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
-    if(!require(MASS, quiet=TRUE)) stop("MASS library is required.")
+    if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
+    if(!require(MASS, quietly=TRUE)) stop("MASS library is required.")
     if(!require(stats)) stop("package stats is required")
     if(!inherits(x, "genlight")) stop("x is not a genlight object.")
     stat <- match.arg(stat)

Modified: pkg/R/glFunctions.R
===================================================================
--- pkg/R/glFunctions.R	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/R/glFunctions.R	2012-06-12 09:07:33 UTC (rev 1009)
@@ -511,7 +511,7 @@
                           grid = TRUE, addaxes = TRUE, origin = c(0,0), include.origin = TRUE,
                           sub = "", csub = 1, possub = "bottomleft", cgrid = 1,
                           pixmap = NULL, contour = NULL, area = NULL, ...){
-    if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
+    if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
 
 
     ## set par

Modified: pkg/R/glPlot.R
===================================================================
--- pkg/R/glPlot.R	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/R/glPlot.R	2012-06-12 09:07:33 UTC (rev 1009)
@@ -19,7 +19,7 @@
     image(x=1:nLoc(x), y=1:nInd(x), z=X, xlab="SNP index", ylab="Individual index", yaxt="n", col=myCol, ...)
 
     ## add y axis
-    axis(side=2, at=nInd(x)-ylabpos+1, lab=ylabpos)
+    axis(side=2, at=nInd(x)-ylabpos+1, labels=ylabpos)
 
     ## add legend
     if(legend){

Modified: pkg/R/handling.R
===================================================================
--- pkg/R/handling.R	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/R/handling.R	2012-06-12 09:07:33 UTC (rev 1009)
@@ -346,7 +346,7 @@
 
     ## handle pop
     listPop <- lapply(x, getPop)
-    pop <- unlist(listPop, use.name=FALSE)
+    pop <- unlist(listPop, use.names=FALSE)
     pop <- factor(pop)
 
     ## handle genotypes

Modified: pkg/R/import.R
===================================================================
--- pkg/R/import.R	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/R/import.R	2012-06-12 09:07:33 UTC (rev 1009)
@@ -454,7 +454,7 @@
     nocomma <- which(! (1:length(txt)) %in% grep(",",txt))
     splited <- nocomma[which(! nocomma %in% pop.idx)]
     if(length(splited)>0){
-        for(i in sort(splited,dec=TRUE)){
+        for(i in sort(splited,decreasing=TRUE)){
             txt[i-1] <- paste(txt[i-1],txt[i],sep=" ")
         }
         txt <- txt[-splited]

Modified: pkg/R/loadingplot.R
===================================================================
--- pkg/R/loadingplot.R	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/R/loadingplot.R	2012-06-12 09:07:33 UTC (rev 1009)
@@ -63,10 +63,10 @@
     ## annotate variables that are above the threshold
     if(sum(x > threshold)>0){
         x.ann <- at[x > threshold]
-        x.ann <- jitter(x.ann,fac=lab.jitter)
+        x.ann <- jitter(x.ann,factor=lab.jitter)
 
         y.ann <- x[x > threshold] + y.offset
-        y.ann <- jitter(y.ann,fac=lab.jitter)
+        y.ann <- jitter(y.ann,factor=lab.jitter)
 
         txt.ann <- lab[x > threshold]
         text(x=x.ann, y=y.ann, label=txt.ann, cex=cex.lab, srt=srt, adj=adj)

Modified: pkg/R/monmonier.R
===================================================================
--- pkg/R/monmonier.R	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/R/monmonier.R	2012-06-12 09:07:33 UTC (rev 1009)
@@ -57,7 +57,7 @@
 
 
 if(scanthres){
-  plot(sort(unique(D)[unique(D) > 0],dec=TRUE),main="Local distances plot",type="l",xlab="rank",ylab="Sorted local distances")
+  plot(sort(unique(D)[unique(D) > 0],decreasing=TRUE),main="Local distances plot",type="l",xlab="rank",ylab="Sorted local distances")
   abline(h=Dlim,lty=2)
   mtext("Dashed line indicates present threshold")
   cat("Indicate the threshold (\'d\' for default): ")
@@ -468,7 +468,7 @@
 	cpoint <- 1
 	clegend <- 0
     }
-    s.value(xy,variable,grid=FALSE,include.ori=FALSE,addaxes=FALSE,neig=neig,
+    s.value(xy,variable,grid=FALSE,include.origin=FALSE,addaxes=FALSE,neig=neig,
             cneig=cneig,clegend=clegend,csize=csize,cpoint=cpoint,pch=20,pixmap=pixmap,
             method=method,sub=sub,csub=csub,possub=possub,add.plot=add.plot)
     opar <- par(no.readonly=TRUE)
@@ -613,7 +613,7 @@
 if(is.null(threshold) || (threshold<0)) {Dlim <- summary(unique(D[D>0]))[5]} else {Dlim <- threshold}
 
 if(scanthres){
-  plot(sort(unique(D)[unique(D) > 0],dec=TRUE),main="Local distances plot", type="l", xlab="rank",ylab="Sorted local distances")
+  plot(sort(unique(D)[unique(D) > 0],decreasing=TRUE),main="Local distances plot", type="l", xlab="rank",ylab="Sorted local distances")
   abline(h=Dlim,lty=2)
   mtext("Dashed line indicates present threshold")
   cat("Indicate the threshold (\'d\' for default): ")
@@ -628,7 +628,7 @@
 bdr.values <- -1 # used so that the first boundary is automatically the best
 
 for(i in 0:(ntry-1)){
-  temp <- monmonier(xy, dist, cn.nb,skip=i,scanthres=FALSE,
+  temp <- monmonier(xy, dist, cn.nb,skip.local.diff=i,scanthres=FALSE,
                             threshold=Dlim, bd.length=bd.length, allowLoop=allowLoop)
   current.bdr.value <- sum(c(temp$run1$dir1$values, temp$run1$dir2$values))
 

Modified: pkg/R/spca.R
===================================================================
--- pkg/R/spca.R	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/R/spca.R	2012-06-12 09:07:33 UTC (rev 1009)
@@ -25,8 +25,8 @@
     if(!any(inherits(obj,c("genind","genpop")))) stop("obj must be a genind or genpop object.")
     invisible(validObject(obj))
     ## checkType(obj)
-    if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
-    if(!require(spdep, quiet=TRUE)) stop("spdep library is required.")
+    if(!require(ade4, quietly=TRUE)) stop("ade4 library is required.")
+    if(!require(spdep, quietly=TRUE)) stop("spdep library is required.")
 
 
     ## handle xy coordinates
@@ -345,21 +345,21 @@
 
     # 1
     if(n<30) clab <- 1 else clab <- 0
-    s.label(xy, clab=clab, include.ori=FALSE, addaxes=FALSE, neig=neig,
+    s.label(xy, clabel=clab, include.origin=FALSE, addaxes=FALSE, neig=neig,
             cneig=1, sub="Connection network", csub=2)
 
     # 2
-    s.image(xy,z, include.ori=FALSE, grid=TRUE, kgrid=10, cgrid=1,
+    s.image(xy,z, include.origin=FALSE, grid=TRUE, kgrid=10, cgrid=1,
             sub=sub, csub=csub, possub="bottomleft")
     box()
 
     # 3
     if(n<30) {neig <- nb2neig(x$lw$neighbours)} else {neig <- NULL}
-    s.value(xy,z, include.ori=FALSE, addaxes=FALSE, clegend=0, csize=.6,
+    s.value(xy,z, include.origin=FALSE, addaxes=FALSE, clegend=0, csize=.6,
             neig=neig, sub=sub, csub=csub, possub="bottomleft")
 
     # 4
-    s.value(xy,z, include.ori=FALSE, addaxes=FALSE, clegend=0, csize=.6,
+    s.value(xy,z, include.origin=FALSE, addaxes=FALSE, clegend=0, csize=.6,
             method="greylevel", neig=neig, sub=sub, csub=csub, possub="bottomleft")
 
     # 5

Modified: pkg/man/auxil.Rd
===================================================================
--- pkg/man/auxil.Rd	2012-06-06 16:06:26 UTC (rev 1008)
+++ pkg/man/auxil.Rd	2012-06-12 09:07:33 UTC (rev 1009)
@@ -19,6 +19,7 @@
 \alias{lightseasun}
 \alias{deepseasun}
 \alias{funky}
+
 \title{ Auxiliary functions for adegenet}
 \description{
   adegenet implements a number of auxiliary procedures that might be of
@@ -44,15 +45,15 @@
   - \code{.genlab}: generate labels in a correct alphanumeric ordering. \cr
   - \code{.readExt}: read the extension of a given file. \cr
 
-  Color palettes include:
-  - \code{bluepal}: white->blue
-  - \code{redpal}: white->red
-  - \code{greenpal}: white->green
-  - \code{flame}: gold->red
-  - \code{seasun}: blue->gold->red
-  - \code{lightseasun}: blue->gold->red (light variant)
-  - \code{deepseasun}: blue->gold->red (deep variant)
-  - \code{funky}: many colors
+  Color palettes include:\cr
+  - \code{bluepal}: white->blue\cr
+  - \code{redpal}: white->red\cr
+  - \code{greenpal}: white->green\cr
+  - \code{flame}: gold->red\cr
+  - \code{seasun}: blue->gold->red\cr
+  - \code{lightseasun}: blue->gold->red (light variant)\cr
+  - \code{deepseasun}: blue->gold->red (deep variant)\cr
+  - \code{funky}: many colors\cr
 }
 \usage{
 adegenetWeb()



More information about the adegenet-commits mailing list