On Aug 24, 2009, at 2:55 AM, Tammy Ma wrote:
Hi, R users,
I have a problem about how to generate random sample interval from a
duration.
For example, during a time duration 0-70s, I want to generate a
sample which last 10s.
the sample could be 0-10 or 30-40s or 25-35s etc
How could I do it in R`??
?runif
Wouldn't you just generate a runif variable for the starting time that
was in the range of 0-60 and then add 10 to each such start time? If
the problem is any more difficult, then you will need to be more
precise.
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.