Description Usage Arguments Value Author(s)

This function finds events (e.g. heat waves or ozone events). The approach is to find consecutive days that are above a thresholds.

1 | ```
findevents(date, x, xmin, mindays = 2, by)
``` |

`date` |
A vector of dates. |

`x` |
The exposure variable (e.g. temperature for heat waves or ozone for ozone events) |

`xmin` |
The minimum value that x must be for at least mindays to qualify as an event. |

`mindays` |
The minimum number of consecutive days that qualify as an event. |

`by` |
A vector of ids or a matrix with columns as the id variables. The events will be found separately within each unique combination of id variables. This is optional. |

Returns a data.table with the columns for by, x, date as well as the following new variables: above and indivator the x>xmin; above_fromstart number of consecutive days that have exceeded xmin through the current date; above_toend the number of remaining days that are above xmin; length the total number of consecutive days that are above xmin; event a logical indivatring a day is part of an event.

Ander Wilson

AnderWilson/smurf documentation built on May 5, 2019, 4:57 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.