Displaying 2 results from an estimated 2 matches for "nindiv".
Did you mean:
indiv
2011 May 12
3
Help with "apply"
Hello R gurus,
I have a simple routine using for loops that i was just trying to make it
faster
y <- rnorm(10)
Nindiv <- 10
x <-matrix(sample(c(0:2),50,re = T),10)
gtemp <- rnorm(10)
ycorr <- array(0,c(Nindiv,1))
for (i in 1:Nindiv) {
for (k in 1:ncol(x)) {
ycorr[i] <- y[i] - x[i,k]*gtemp[k]
}
}
It works fine but I wanted to make it faster and I think an apply function
could probably solve this...
2009 Jan 13
3
problem whit Geneland
I do the these passages:
library(Geneland)
set.seed(1)
data <- simdata(nindiv=200,
coord.lim=c(0,1,0,1) ,
number.nuclei=5 ,
allele.numbers=rep(10,20),
IBD=FALSE,
npop=2,
give.tess.grid=FALSE)
geno <- data$genotypes
coord <- t(data$coord.indiv)
path.mcmc <- paste(tempdir...