
 gab <- chooseCN(sim2pop@other$xy,ask=FALSE,type=2)

     # filter random noise 
     pca1 <- dudi.pca(sim2pop@tab,scale=FALSE, scannf=FALSE, nf=1)

     # run the algorithm
     mon1 <- monmonier(sim2pop@other$xy,dist(pca1$l1[,1]),gab,scanthres=FALSE)

     pca1 <- dudi.pca(sim2pop@tab,scale=FALSE, scannf=FALSE, nf=1)

     mon1 <- monmonier(sim2pop@other$xy,dist(pca1$l1[,1]),gab,scanthres=FALSE)

plot(mon1)
plot(mon1,cex=2)
plot(mon1,lwd=2)
args(plot.monmonier)
plot(mon1,bwd=10)
plot(mon1,bwd=100)
plot(mon1,bwd=100, add.ar=FALSE)
     plot(mon2,mondata2$x2,method="greylevel",add.arr=FALSE,bwd=6,col="red",csize=.5)

 plot(mon2,method="greylevel",add.arr=FALSE,bwd=6,col="red",csize=.5)
 plot(mon2,method="greylevel",add.arr=FALSE,bwd=10,col="red",csize=.5)
     mon1 <- monmonier(sim2pop@other$xy,dist(pca1$l1[,1]),gab,scanthres=FALSE)

plot(mon1)
plot(mon1,add.arr=FALSE)
plot(mon1,add.arr=FALSE, bwd=4)
plot(mon1,add.arr=FALSE, bwd=40)
debug(plot.monmonier)
plot(mon1)
val.1
cex.bwd
cex.bwd.1
val.1
val.2
val.1
val.2
cex.bwd.1
cex.bwd.2
max(c(cex.bwd.1,cex.bwd.2))
max(c(cex.bwd.1,cex.bwd.2),na.rm=TRUE)
args(max)
cex.bwd.1
cex.bwd.12
cex.bwd.2
Q
 plot(mon1)
Q
undebug(mon1)
undebug(plot.monmonier)
plot(mon1)
source("/home/master/dev/adegenet/pkg/R/monmonier.R")
plot(mon1)
source("")
q()
n
plot(mon1)
example(monmonier)
rm(monmonier)
rm(plot.monmonier)
save.image()
example(monmonier)
?monmonier
     plot(mon1,x1,met="greylevel",csize=.6)

     data(sim2pop)

     gab <- chooseCN(sim2pop@other$xy,ask=FALSE,type=2)

     pca1 <- dudi.pca(sim2pop@tab,scale=FALSE, scannf=FALSE, nf=1)

     gab <- chooseCN(sim2pop@other$xy,ask=FALSE,type=2)

     mon1 <- monmonier(sim2pop@other$xy,dist(pca1$l1[,1]),gab,scanthres=FALSE)

plot(mon1,var=pca1$l1[,1])
    
plot(mon1,var=pca1$l1[,1])
     temp <- sim2pop@pop
     levels(temp) <- c(17,19)
     temp <- as.numeric(as.character(temp))
     plot(mon1)
     points(sim2pop@other$xy,pch=temp,cex=2)
     legend("topright",leg=c("Pop A", "Pop B"),pch=c(17,19))

  xy <- matrix(runif(120,0,10), ncol=2)
     x1 <- rnorm(60)
     x1[xy[,2] > 5] <- x1[xy[,2] > 5]+3
     cn1 <- chooseCN(xy,type=1,ask=FALSE)
     mon1 <- optimize.monmonier(xy,dist(x1)^2,cn1,ntry=10)

     # graphics
     plot(mon1,x1,met="greylevel",csize=.6)

10
plot(mon1)
     mon1 <- optimize.monmonier(xy,dist(x1)^2,cn1,ntry=10)

d
plot(mon1)
plot(mon1,x1)
 x2 <- rnorm(60)
     sel <- (xy[,1]>3.5 & xy[,2]>3.5 & xy[,1]<6.5 & xy[,2]<6.5)
     x2[sel] <- x2[sel]+4
     cn2 <- chooseCN(xy,type=1,ask=FALSE)
     mon2 <- optimize.monmonier(xy,dist(x2)^2,cn2,ntry=10)

     # graphics
     plot(mon2,x2,method="greylevel",add.arr=FALSE,bwd=6,col="red",csize=.5)
     ## End(Not run)
d
     plot(mon2,x2,method="greylevel",add.arr=FALSE,bwd=6,col="red",csize=.5)

 x2 <- rnorm(60)
     sel <- (xy[,1]>3.5 & xy[,2]>3.5 & xy[,1]<6.5 & xy[,2]<6.5)
     x2[sel] <- x2[sel]+4
   
     mon2 <- optimize.monmonier(xy,dist(x2)^2,cn2,ntry=10)

d
     plot(mon2,x2,method="greylevel",add.arr=FALSE,bwd=6,col="red",csize=.5)

q()
y
plot(mon1,x1)
orig_coords <- read.table("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.03/boot_coord.7.input")
numpops <- length(orig_coords[,1])

coords <- orig_coords
numpops <- length(coords[,1])
Da <- read.table("/home/master/dev/adegenet/pkg/misc/bug-report.1.2-2.03/boot_dist.7.input")
Da <- as.dist(Da)

	# Calc monmonier barrier
	cn <- chooseCN(coords, ask=FALSE, type=1)
	mon <- monmonier(coords, Da, cn, threshold=0, nrun=1, skip.local.diff = rep(1, 1)) #threshold is arbitrarily set at 0
plot(mon)
plot(mon,add.arr=FALSE)
	mon <- optimize.monmonier(coords, Da, cn, threshold=0)

q()
n
coords
source("/home/master/dev/adegenet/pkg/R/monmonier.R")
	mon <- optimize.monmonier(coords, Da, cn, threshold=0)

plot(mon)
q()
y
