generate_cotime_with_buffer: Generate co-expansion time

Description Usage Arguments Details Value

View source: R/generate_cotime_with_buffer.R

Description

This function randomly draw events' time from a time range. User can specify the minimal time length (buffer) between events

Usage

1
generate_cotime_with_buffer(time.range, nco.events, buffer = 0)

Arguments

time.range

A numeric vector of length 2 giving the minimal and maximum time.

nco.events

An integer. The number of co-expansion events. See 'Details'.

buffer

A numeric. The minimal amount of time separating two events. The default is 0, when events' time are sampled randomly

Details

Note that the buffer is the time length on each side of a expansion event. If the buffer is non-zero,the maximum number of events (max nco.event)=time.range/buffer +2. However, for a large nco.events, even if it does not exceed the maximum, this function might take a while to find a set of time that are at least buffer apart from each other.

Value

A numeric vector of length nco.events containing the sampled expansion time


huatengh/CoExpansionValidation documentation built on Nov. 19, 2021, 11:07 a.m.