get_event_years: Get years with events for an 'fhx' object

Description Usage Arguments Value See Also Examples

View source: R/utils.R

Description

Get years with events for an fhx object

Usage

1
2
3
4
5
6
get_event_years(
  x,
  scar_event = TRUE,
  injury_event = FALSE,
  custom_grep_str = NULL
)

Arguments

x

An fhx object.

scar_event

Boolean indicating whether years with scar events should be returned. Default is TRUE.

injury_event

Boolean indicating whether years with injury events should be returned. Default is FALSE.

custom_grep_str

Character string to pass a custom grep search pattern to search x "rec_type" column for. NULL by default.

Value

A list. Elements of the list are numeric vectors giving the years with events for each fhx series. Each element's name reflects the series' name.

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(pgm)
get_event_years(pgm, scar_event = TRUE, injury_event = TRUE)

# Passing a custom string to grep. This one identified recorder years:
get_event_years(pgm, custom_grep_str = "recorder_")

# Use with composite to get composite years:
comp <- composite(pgm, comp_name = "pgm")
event_yrs <- get_event_years(comp)[["pgm"]]
print(event_yrs)

burnr documentation built on March 10, 2021, 5:07 p.m.