- using R Under development (unstable) (2025-12-23 r89222 ucrt)
- using platform: x86_64-w64-mingw32
- R was compiled by
gcc.exe (GCC) 14.3.0
GNU Fortran (GCC) 14.3.0
- running under: Windows Server 2022 x64 (build 20348)
- using session charset: UTF-8
- checking for file 'marginaleffects/DESCRIPTION' ... OK
- this is package 'marginaleffects' version '0.31.0'
- package encoding: UTF-8
- 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 hidden files and directories ... OK
- checking for portable file names ... OK
- checking whether package 'marginaleffects' can be installed ... OK
See the install log for details.
- checking installed package size ... OK
- checking package directory ... OK
- checking 'build' directory ... OK
- checking DESCRIPTION meta-information ... OK
- 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 ... [1s] OK
- checking whether the package can be loaded with stated dependencies ... [0s] OK
- checking whether the package can be unloaded cleanly ... [1s] OK
- checking whether the namespace can be loaded with stated dependencies ... [0s] OK
- checking whether the namespace can be unloaded cleanly ... [1s] OK
- checking loading without being on the library search path ... [1s] OK
- checking whether startup messages can be suppressed ... [0s] 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 ... [22s] OK
- checking Rd files ... [2s] OK
- checking Rd metadata ... 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 installed files from 'inst/doc' ... OK
- checking files in 'vignettes' ... OK
- checking examples ... [1s] ERROR
Running examples in 'marginaleffects-Ex.R' failed
The error most likely occurred in:
> ### Name: datagrid
> ### Title: Data grids
> ### Aliases: datagrid
>
> ### ** Examples
>
> # The output only has 2 rows, and all the variables except `hp` are at their
> # mean or mode.
> datagrid(newdata = mtcars, hp = c(100, 110))
rowid mpg cyl disp drat wt qsec vs am gear carb hp
1 1 20.09062 6 230.7219 3.596563 3.21725 17.84875 0 0 4 3 100
2 2 20.09062 6 230.7219 3.596563 3.21725 17.84875 0 0 4 3 110
>
> # We get the same result by feeding a model instead of a data.frame
> mod <- lm(mpg ~ hp, mtcars)
> datagrid(model = mod, hp = c(100, 110))
rowid mpg hp
1 1 20.09062 100
2 2 20.09062 110
>
> # Use in `marginaleffects` to compute "Typical Marginal Effects". When used
> # in `slopes()` or `predictions()` we do not need to specify the
> # `model` or `newdata` arguments.
> slopes(mod, newdata = datagrid(hp = c(100, 110)))
Error in `[.data.table`(out, , `:=`(tmp_idx, seq_len(.N)), by = tmp) :
attempt access index 10/10 in VECTOR_ELT
Calls: slopes ... <Anonymous> -> do.call -> get_comparisons -> [ -> [.data.table
Execution halted
- checking for unstated dependencies in 'tests' ... OK
- checking tests ... [1s] OK
Running 'spelling.R' [0s]
Running 'tinytest.R' [0s]
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes ... OK
- checking re-building of vignette outputs ... [2s] OK
- checking PDF version of manual ... [23s] OK
- checking HTML version of manual ... [16s] OK
- DONE
Status: 1 ERROR