The fires
function creates a copy of the fire dataset and adjusts the dates
to align with the current date while maintaining the original date patterns.
fires()
A data.table with updated dates, shifted to the current date
The function performs the following operations:
Creates a copy of the fire dataset from the mintyr package
Calculates the number of days between the last recorded date and the previous day
Shifts all dates forward by the calculated number of days
Converts the updated dates back to character format
Requires the data.table
and mintyr
packages
Uses the current system date as a reference for date shifting
Maintains the original structure of the date column
head(fires())
#> Location Tag Date Entry Exit Ent Wt Ext Wt Consumed Weight
#> <int> <int> <char> <char> <char> <num> <num> <num> <num>
#> 1: 101 35877 2024-10-06 14:15:39 14:18:02 0.678 0.632 0.046 67.6
#> 2: 101 35873 2024-10-06 14:18:03 14:23:05 0.632 0.384 0.248 60.8
#> 3: 101 35878 2024-10-06 14:23:15 14:28:45 0.670 0.469 0.201 70.8
#> 4: 101 35855 2024-10-06 14:29:05 14:34:29 0.755 0.634 0.121 51.2
#> 5: 101 35877 2024-10-06 14:34:30 14:34:37 0.634 0.634 0.000 0.0
#> 6: 101 35853 2024-10-06 14:34:38 14:36:26 0.634 0.634 0.000 88.6
#> Topup Amount
#> <num>
#> 1: 0.286
#> 2: 0.000
#> 3: 0.286
#> 4: 0.286
#> 5: 0.000
#> 6: 0.000