- using R Under development (unstable) (2025-12-18 r89199)
- using platform: x86_64-pc-linux-gnu
- R was compiled by
gcc-15 (Debian 15.2.0-11) 15.2.0
GNU Fortran (Debian 15.2.0-11) 15.2.0
- running under: Debian GNU/Linux forky/sid
- using session charset: UTF-8
- checking for file ‘insurancerating/DESCRIPTION’ ... OK
- checking extension type ... Package
- this is package ‘insurancerating’ version ‘0.7.5’
- package encoding: UTF-8
- checking CRAN incoming feasibility ... [1s/1s] OK
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking serialization versions ... OK
- checking whether package ‘insurancerating’ can be installed ... OK
See the install log for details.
- checking package directory ... OK
- checking for future file timestamps ... OK
- checking DESCRIPTION meta-information ... NOTE
Missing dependency on R >= 4.1.0 because package code uses the pipe
|> or function shorthand \(...) syntax added in R 4.1.0.
File(s) using such syntax:
‘autoplot.restricted.Rd’ ‘autoplot.riskfactor.Rd’ ‘rating_factors.Rd’
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [3s/4s] OK
- checking whether the package can be loaded with stated dependencies ... [3s/4s] OK
- checking whether the package can be unloaded cleanly ... [3s/3s] OK
- checking whether the namespace can be loaded with stated dependencies ... [3s/4s] OK
- checking whether the namespace can be unloaded cleanly ... [3s/4s] OK
- checking loading without being on the library search path ... [3s/5s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [21s/25s] OK
- checking Rd files ... [0s/1s] OK
- checking Rd metadata ... OK
- checking Rd line widths ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of ‘data’ directory ... OK
- checking data for non-ASCII characters ... [0s/0s] OK
- checking LazyData ... OK
- checking data for ASCII and uncompressed saves ... OK
- checking examples ... [11s/13s] ERROR
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
- checking for unstated dependencies in ‘tests’ ... OK
- checking tests ... [16s/20s] OK
Running ‘testthat.R’ [15s/19s]
- checking PDF version of manual ... [4s/6s] OK
- checking HTML version of manual ... [2s/4s] OK
- checking for non-standard things in the check directory ... OK
- DONE
Status: 1 ERROR, 1 NOTE