[R] Geneland error on unix: Error in MCMC(........ :, unused argument(s) (ploidy = 2, genotypes = geno)

Nevil Amos nevil.amos at gmail.com
Thu May 20 11:34:11 CEST 2010


I am receiving the above error ( full r session output below)  the 
script runs OK in windows.  and "genotypes" and "ploidy" are both 
correct arguments

any suggestions would be most welcome

Nevil Amos
MERG/ACB
Monash University School of Biological Sciences







 > library(Geneland)
Loading required package: RandomFields
Loading required package: fields
Loading required package: spam
Package 'spam' is loaded. Spam version 0.21-0 (2010-03-13).
Type demo( spam) for some demos, help( Spam) for an overview
of this package.
Help for individual functions is optained by adding the
suffix '.spam' to the function name, e.g. 'help(chol.spam)'.

Attaching package: 'spam'

The following object(s) are masked from 'package:base':

     backsolve, forwardsolve, norm

  Try help(fields) for an overview of this library
fields web: http://www.image.ucar.edu/Software/Fields
Loading required package: mapproj
Loading required package: maps
Loading required package: snow
Loading required package: tcltk
Loading Tcl/Tk interface ... done
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
o        Geneland is loaded                                       o
o                                                                 o
o        * Please *                                               o
o                                                                 o
o        Register on                                              o
o        http://www2.imm.dtu.dk/~gigu/Geneland/register.php       o
o                                                                 o
o        See manual on                                            o
o        http://www2.imm.dtu.dk/~gigu/Geneland/#Manual            o
o                                                                 o
o        Type citation("Geneland") for a quick citation guide     o
o                                                                 o
o        See http://www2.imm.dtu.dk/~gigu/Geneland/#              o
o        for additional references                                o
o                                                                 o
o        This is Geneland-3.2.1                                   o
o                                                                 o
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Warning message:
In fun(...) : no DISPLAY variable so Tk is not available
 > DIRLIST<-c("Adult_ALL 
NO_ANW/")#,"Adult_Or_ANW/","Adult_Females/","Adult_Males/")
 > for(d in DIRLIST){
+ theWd<- paste("/nfs/monash/home/namos/Rwork/",d,sep="")
+ setwd(theWd)
+ SPP.CODES <-"EYR"#c("BT","EYR","FH","SPP","STP")
+ for (sp in  SPP.CODES){
+ path.sp<- paste(theWd,sp,"/",sep="")
+ dir.create(path.sp)
+ GENO.TABLE<-paste(theWd,sp,"geno",sep="")
+ XY.TABLE<-paste(theWd,sp,"xy",sep="")
+ MINPOP=1
+ MAXPOP=25
+ INITPOP=1
+ NITS=500000
+ THIN=NITS/1000
+ nrun <- 10
+ burnin <- 200
+ geno<-noquote(read.table(GENO.TABLE))
+ coord<-read.table(XY.TABLE)
+
+ ## Loop for multiple runs
+
+ for(irun in 1:nrun)
+ {
+ ## define path to MCMC directory
+
+ path.mcmc <- paste(path.sp,irun,"/",sep="")
+ dir.create(path.mcmc)
+ MCMC(coordinates=coord, ploidy=2, genotypes=geno, varnpop=T, 
npopmax=MAXPOP, npopinit=MINPOP, spatial=T, freq.model="Correlated", 
nit=NITS, thinning=500, rate.max=nrow(geno), delta.coord=100, 
path.mcmc=path.mcmc)
+ ## MCMC postprocessing
+ PostProcessChain(coordinates=coord,path.mcmc=path.mcmc,genotypes=geno, 
nxdom=50,nydom=50,burnin=burnin)
+ }
+ ## Computing average posterior probability
+
+ lpd <- rep(NA,nrun)
+ for(irun in 1:nrun)
+ {
+ path.lpd <- paste(path.mcmc,"log.posterior.density.txt",sep="")
+ lpd[irun] <- mean(scan(path.lpd)[-(1:burnin)])
+ }
+ ## Runs sorted by decreasing average posterior probability:
+ order(lpd,decreasing=TRUE)
+
+ #pdf("Number of pops.pdf",((210-10)/25.4),((297-10)/25.4))
+ #theWd<-getwd()
+ ##setwd(theWd)
+ #par(mfrow = c(5, 2),cex=0.25)
+ #for(irun in 1:nrun)
+ #
+ #{
+ #
+ ###Below is code form the Geneland Plotnpop function
+ #    fileparam <- paste(path.mcmc, "parameters.txt", sep = "")
+ #    param <- as.matrix(read.table(fileparam))
+ #    thinning <- as.numeric(param[param[, 1] == "thinning", 3])
+ #    filenpop <- paste(path.mcmc, "populations.numbers.txt", sep = "")
+ #    npop <- scan(filenpop)
+ #     sub <- -(1:burnin)
+ #
+ #plot((1:length(npop)) * thinning, npop, type = "l",ylab = "Number of 
classes", xlab = "Index of MCMC iteration Whole 
chain",main=paste(path.mcmc,"\n","Run:", irun, sep = " "), ylim = c(1, 
max(npop)+ 0.5))
+ #hist(npop[sub], plot = TRUE, prob = TRUE, breaks = seq(0.5,max(npop) 
+ 0.5, 1), xlab = paste("Nb. of pop. along the chain (after a burnin of 
", burnin, "x", thinning, "i t.)", sep = ""), main = "Number of 
populations long the chain after burnin")
+ #
+ #
+ #}
+ #dev.off()
+ }
+ }
Error in MCMC(coordinates = coord, ploidy = 2, genotypes = geno, varnpop 
= T,  :
   unused argument(s) (ploidy = 2, genotypes = geno)
Execution halted



More information about the R-help mailing list