Description Usage Arguments Value Examples
View source: R/increase_intensity.R
Increase event size intensity
1 | incr_event_intensity(x, from = 1, to = 1)
|
x |
numeric vector (daily precip) |
from |
positive integer. The number of events to take precip from and add to the following event(s) |
to |
positive integer. The number of events to add the removed precip to |
numeric vector, same length as x. Precip events are considered 1 or more consecutive days with precip. Precip was removed from one or more (from) events and added to one or more (to) events, and this is repeated for all events
1 2 3 4 5 6 7 8 9 10 11 | y1 <- incr_event_intensity(c(0.1, 0.1, 0, 1))
all.equal(y1, c(0, 0, 0, 1.2))
y2 <- incr_event_intensity(c(0.2, 0.1, 0.1, 0, 1, 2))
all.equal(y2, c(0, 0, 0, 0, 1.2, 2.2))
# 2 events added to 1
y3 <- incr_event_intensity(c(0.1, 0, 0.2, 0.1, 0, 1),
from = 2, to = 1)
all.equal(y3, c(0, 0, 0, 0, 0, 1.4))
y4 <- incr_event_intensity(c(0.3, 0, 0.2, 0.1, 0, 1, 0, 1),
from = 1, to = 2)
all.equal(y4, c(0, 0, 0.3, 0.2, 0, 1.1, 0, 1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.