Displaying 2 results from an estimated 2 matches for "randomtod".
Did you mean:
random_id
2008 Aug 19
0
R-code: for those who like a challenge; HELP
...gits=1)*10
### 8 Generating random time or x coordinate
### 9 First generating random time within recall period
randomrecall<-round(runif(n=1,min=recallmin,max=recallmax))
### 10 Second generating random time of displacement (this
todrange<-todmax-todmin
proprand<-runif(n=1,min=0,max=1)
randomtod<-0
for(i in 1:todrange){
if (proprand>data[[9+i]] & proprand<=data[[10+i]]) randomtod=i
}
### 11 Thus
x<-randomtod-randomrecall
### 12 Generating population weight
weight<-round(pop*data[[9+randomtod]])/100000
### 13 Function returns a vector onesurvey consisting of three valu...
2008 Aug 16
0
use of all row elements
...ing x.
## Generating random time or x coordinate (through random time of displacement - random recall)
## First generating random time within recall period
randomrecall<-round(runif(n=1,min=recallmin,max=recallmax))
## Second generating random time of displacement
todrange<-todmax-todminrandomtod<-0for(i in 1:todrange){if (proprand>data[[9+i]] & proprand<=data[[10+i]]) randomtod=i}
Following messages are given:
Warning messages:1: In 1:todrange : numerical expression has 50 elements: only the first used2: In if (proprand > data[[9 + i]] & proprand <= data[[10 + i...