simulate_bites | R Documentation |
Simulates either sinusoidal or plateau-like bites.
simulate_bites( no.of.bites = 5, length.of.bite = 1000, length.of.series = 10000, max.y = 1, max.y.jit = NULL, peak.pos = 50, slope.perc.start = 10, slope.perc.end = slope.perc.start, jit = NULL, bite.type = "sin", plot = TRUE )
no.of.bites |
Number of bites in time series. Default: |
length.of.bite |
Length of each bite. Default: |
length.of.series |
Length of the whole time series. Default: |
max.y |
Maximum y value. Default: |
max.y.jit |
Jitter above and below maximum y value in |
peak.pos |
Position (in percent) of peak within peak curve.
Only applies to |
slope.perc.start |
Percentage of how much of the whole bite is defined by the ascending slope.
Only applies to |
slope.perc.end |
Percentage of how much of the whole bite is defined by the descending slope.
Only applies to |
jit |
Jitter along the whole time series. Default: |
bite.type |
String: either "sin" or "plat" for sinusoidal or plateau-like bites, respectively. Default: |
plot |
Logical. If |
Returns a tibble with the columns t
and y
containing simulated bites.
# simulate a time series with sinusoidal bites # where the peaks are located in the centers of the bites. simulate_bites(no.of.bites = 5, length.of.bite = 1000, length.of.series = 10000, max.y = 5, max.y.jit = 15, jit = 0.5, peak.pos = 0.5, bite.type = "sin", plot = TRUE) # simulate a time series with sinusoidal bites # where the peaks are located towards the ends of the bites. simulate_bites(no.of.bites = 5, length.of.bite = 1000, length.of.series = 10000, max.y = 5, max.y.jit = 15, jit = 0.5, peak.pos = 0.8, bite.type = "sin", plot = TRUE) # simulate a time series with plateau-like bites simulate_bites(no.of.bites = 5, length.of.bite = 1000, length.of.series = 10000, max.y = 5, max.y.jit = 15, jit = 1, bite.type = "plat", plot = TRUE) # simulate a time series with plateau-like bites # with slowly ascending bite start and abprupt bite end. simulate_bites(no.of.bites = 5, length.of.bite = 1000, length.of.series = 10000, max.y = 5, max.y.jit = 15, slope.perc.start = 60, slope.perc.end = 10, jit = 1, bite.type = "plat", plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.