Description Usage Format Source Examples
The genetic data of sim03
correspond to the first 100 individuals of the data contained in sim01
(See sim01
for details).
1 |
An object of class ggene
.
Leblois, R., A. Estoup and F. Rousset 2009. IBDSim: a computer program to simulate genotypic data under isolation by distance. Molecular Ecology Resources 9: 107-109.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | data(sim03)
# plot the spatial distribution of individuals
plot(sim03$coord[,1], sim03$coord[,2], asp=1)
# compute variogram
va <- svariog(X=sim03, uvec=distlag(dist=sim03$coord, dmin=1, distance.lag=1), plot=FALSE)
plot(va$svario$u, va$svario$v, xlab="distance", ylab="semivariance")
abline(h=va$Hhat, col="red", lty="dashed")
## Not run:
# compute statistical envelope
env <- randsvariog(var=va, X=sim03, nsim=30, bounds=c(0.025, 0.975), save.sim=FALSE)
# plot results
plot(env$svario$u, env$svario$v, ylim=range(env$env), xlab="distance", ylab="semi-variance")
abline(h=va$Hhat, col="red", lty="dashed")
points(env$svario$u, env$env[,1], type="l")
points(env$svario$u, env$env[,2], type="l")
## End(Not run)
# fit exponential model to the empirical variogram
fit <- fitsvariog(vario=va, ini.cov.pars=c(0.5,20), nugget=0.8, max.dist=30, plot = FALSE)
fit$param
# plot results
plot(va$svario$u, va$svario$v)
lines(fit$fit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.