Generate a tibble of epochs.
make_epochs(
start_year = 1987,
end_year = 2020,
epoch_step = 5,
epoch_overlap = TRUE
)
Minimum year in epochs
Maximum year in epochs
Numeric. How many years in an epoch?
Logical. Should epochs overlap by one year? i.e.
epoch_step = 10
with epoch_overlap = TRUE
gives, say, 2000-2010 and
2010-2020 whereas epoch_overlap = FALSE
gives 2000-2009 and
2010-2019.
Tibble with columns
First year of epoch
Last year of epoch
List column containing the years for the epoch
Last two digits of first year and last year in epoch. e.g. 10-19.
List column of full path of raster files to summarise.
now <- as.numeric(format(Sys.Date(), "%Y"))
make_epochs(now - 30, now, 10)
#> # A tibble: 3 × 5
#> start_year end_year years epoch epoch_now
#> <dbl> <dbl> <list> <ord> <lgl>
#> 1 1995 2005 <int [11]> 95-05 FALSE
#> 2 2005 2015 <int [11]> 05-15 FALSE
#> 3 2015 2025 <int [11]> 15-25 TRUE
make_epochs(now - 30, now, 10, F)
#> # A tibble: 4 × 5
#> start_year end_year years epoch epoch_now
#> <dbl> <dbl> <list> <ord> <lgl>
#> 1 1995 1995 <int [1]> 95-95 FALSE
#> 2 1996 2005 <int [10]> 96-05 FALSE
#> 3 2006 2015 <int [10]> 06-15 FALSE
#> 4 2016 2025 <int [10]> 16-25 TRUE