Description Usage Arguments Details Value Author(s) See Also Examples
Randomization of the genetic data with no change of the spatial position of the individuals. The function return the statistical envelope for the specified quantiles.
1 |
var |
An object of class |
X |
A |
weights |
A matrix of weights. Typically an object produced by |
nsim |
The number of permutations to be performed. |
bounds |
2 numerical values indicating the probability for which the quantiles are computed. Defaults set to 0.975 and 0.025. |
save.sim |
A logical value. If |
... |
additional arguments to be passed to the function |
The function performs permutations of the genetic data while keeping the spatial position of the individuals unchanged. The semivariance is computed for each "randomized" dataset. The upper and lower bounds are derived from the randomized values of the semivariance at each spatial lag.
svario |
An object of class |
env |
the quantiles corresponding to the upper and lower bounds; |
simul |
OPTIONAL. A data.frame where columns contain the values of the semi-variance for each lag for each permutation. |
Jean-Pierre Rossi <ggene.package@gmail.com>
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | data(larix2300)
# check sampling scheme
plot(larix2300$coord[,1],larix2300$coord[,2])
# compute variogram
va <- svariog(X=larix2300, uvec=distlag(dist=larix2300$coord, dmin=0, distance.lag=3),
plot=FALSE)
plot(va$svario$u, va$svario$v)
## Not run:
# compute statistical envelope
env <- randsvariog(var=va, X=larix2300, 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")
points(env$svario$u, env$env[,1], type="l")
points(env$svario$u, env$env[,2], type="l")
# Repeated genotypes: envelopes for raw and weighted variograms
data(crypho)
#compute the weights
count <- genocount(X=crypho)
mat <- genoweight(X=crypho,genotyp=count$vec)
#performs the randomizations on raw variogram
va <- svariog(X=crypho, plot=FALSE)
env <- randsvariog(var=va, X=crypho, nsim=30, bounds=NULL, save.sim=FALSE)
#compute the weighted variogram
wva <- varioWeight(X=crypho, weights=mat)
#performs the randomizations on weighted variogram
env2 <- randsvariog(var=wva, X=crypho, nsim=30, bounds=NULL, save.sim=FALSE, weights=mat)
# Plot results
# plot results
xx <- c(wva$svario$u, rev(wva$svario$u))
yy <- c(env$env[,1], rev(env$env[,2]))
plot(xx, yy, type = "n", xlab = "distance", ylab = "semivariance",
ylim=range(c(env$env[,1], env$env[,2], env2$env[,1], env2$env[,2])))
polygon(xx, yy, col = "lightgrey", border = "black")
xx <- c(wva$svario$u, rev(wva$svario$u))
yy <- c(env2$env[,1], env2$env[,2])
points(xx, yy, type = "l")
polygon(xx, yy, col = "lightblue", border = "blue")
points(wva$svario$u, wva$svario$v, col="blue", typ="b")
points(wva$svario$u, wva$svario$gamma, col="black", type="b", lty="solid", bty="n")
legend("top", legend=c("raw", "weighted"), col=c("black", "blue"), lty="solid", bty="n")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.