# NOT RUN {
require("Geneland")
data(eco.test)
# We create a folder in the working directory for the results and
# save the data frames of the object "eco" in the format required
# by Geneland:
path.1 <- getwd()
path <- paste(path.1,"/test/", sep="")
dir.create(path)
setwd(path)
ecogen2geneland(eco, ploidy = 2)
# Auxiliar function for running some repetitions with fixed K = 4.
# Each repetition is saved in the folder "test":
simul <- function(i) {
path <- getwd()
path <- paste(path,"/",i, sep = "")
dir.create(path)
MCMC(coordinates = read.table("XY.txt"),
geno.dip.codom = read.table("G.txt"),
varnpop = TRUE, npopmin = 4, npopmax = 4, spatial = TRUE,
freq.model = "Correlated", nit = 500, thinning = 10,
path.mcmc = path)
}
# 5 repetitions with K = 4
lapply(1:5, simul)
# Check that in the folder "test" are the simulated result.
# Your results must have that appearance.
# Plot of the repetition order number vs the corresponding
# posterior probability, with a burn-in of 10 mcmc:
eco.post.geneland(5, 10)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab