Running examples in ‘insurancerating-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: rows_per_date
> ### Title: Find active rows per date
> ### Aliases: rows_per_date
> 
> ### ** Examples
> 
> library(lubridate)

Attaching package: ‘lubridate’

The following objects are masked from ‘package:base’:

    date, intersect, setdiff, union

> portfolio <- data.frame(
+ begin1 = ymd(c("2014-01-01", "2014-01-01")),
+ end = ymd(c("2014-03-14", "2014-05-10")),
+ termination = ymd(c("2014-03-14", "2014-05-10")),
+ exposure = c(0.2025, 0.3583),
+ premium =  c(125, 150),
+ car_type = c("BMW", "TESLA"))
> 
> ## Find active rows on different dates
> dates0 <- data.frame(active_date = seq(ymd("2014-01-01"), ymd("2014-05-01"),
+ by = "months"))
> rows_per_date(portfolio, dates0, df_begin = begin1, df_end = end,
+ dates_date = active_date)
      begin1        end termination exposure premium car_type index_df
1 2014-01-01 2014-03-14  2014-03-14   0.2025     125      BMW        1
2 2014-01-01 2014-05-10  2014-05-10   0.3583     150    TESLA        2
3 2014-01-01 2014-03-14  2014-03-14   0.2025     125      BMW        1
4 2014-01-01 2014-05-10  2014-05-10   0.3583     150    TESLA        2
5 2014-01-01 2014-03-14  2014-03-14   0.2025     125      BMW        1
6 2014-01-01 2014-05-10  2014-05-10   0.3583     150    TESLA        2
7 2014-01-01 2014-05-10  2014-05-10   0.3583     150    TESLA        2
8 2014-01-01 2014-05-10  2014-05-10   0.3583     150    TESLA        2
  active_date index_dates
1  2014-01-01           1
2  2014-01-01           1
3  2014-02-01           2
4  2014-02-01           2
5  2014-03-01           3
6  2014-03-01           3
7  2014-04-01           4
8  2014-05-01           5
> 
> ## With extra identifiers (merge claim date with time interval in portfolio)
> claim_dates <- data.frame(claim_date = ymd("2014-01-01"),
+ car_type = c("BMW", "VOLVO"))
> 
> ### Only rows are returned that can be matched
> rows_per_date(portfolio, claim_dates, df_begin = begin1,
+    df_end = end, dates_date = claim_date, car_type)
Error in data.table::foverlaps(df1, lookup2, type = "any", which = FALSE,  : 
  attempt access index -1/4 in VECTOR_ELT
Calls: rows_per_date -> <Anonymous>
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
                    user system elapsed
autoplot.univariate 5.71   0.11   5.734