Displaying 1 result from an estimated 1 matches for "output_offspring".
2010 May 16
2
sample
...l the offspring, but
that does not work. I get always only the offspring from the last
females. There must be a mistake in my script:
moms<-read.delim("females.txt", stringsAsFactors=FALSE,header=TRUE)
dads<-read.delim("males.txt", stringsAsFactors=FALSE,header=TRUE)
output_offspring<-data.frame()
for (i in 1:nrow(moms)){
rdad=sample(1:nrow(dads),1)
kid<-c(sample(moms[i,2:5],2),sample(dads[rdad,2:5],2))
output_offspring<-rbind(output_offspring,c(moms$SampleID[i],dads
$SampleID[rdad],kid))
}
write
.table
(output_offspring,"offspring_7.txt",row.na...