-
Notifications
You must be signed in to change notification settings - Fork 395
Description
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
I receive an error when trying to display an object in Quarto via GitHub Actions on Linux using df-print:paged. Specifically, the object is pooled results from a lm() fit to multiply imputed data (imputed using the mice package). I receive the error when pooling results using mice::pool() in Quarto (when running on GitHub Actions). Oddly enough, I don't receive an error when running the code in a .R file locally on my PC (or even when running the code in a .R file on Linux GitHub Actions). However, I do receive the error locally on my PC when using Quarto. Interestingly, I seem to receive the error when I specify df-print:paged in the _quarto.yml file. I do not receive the error when I remove df-print:paged in the _quarto.yml file. I had previously posted the bug in amices/mice#733, but it seems it may be a Quarto bug.
Here is the error I receive:
Warning in `[<-.data.frame`(`*tmp*`, is_list, value = list(`3` = "<df[,11] [0 ×
11]>", : replacement element 1 has 1 row to replace 0 rows
Warning in `[<-.data.frame`(`*tmp*`, is_list, value = list(`3` = "<df[,11] [0 ×
11]>", : replacement element 2 has 1 row to replace 0 rows
Error:
! arguments imply differing number of rows: 1, 0The error seems related to the following issue: rstudio/rstudio#15459.
In summary:
- it works when running it locally on my PC: https://isaactpetersen.github.io/QuartoReprexForEdit/#sec-pc
- it works when running the code via a
.Rfile on Linux (via GitHub Actions): https://isaactpetersen.github.io/QuartoReprexForEdit/#sec-linux - it works when running the code on Quarto (via GitHub Actions on Linux) when NOT specifying
df-print:paged - it doesn't work when run on Quarto (via GitHub Actions on Linux) when specifying
df-print:paged: https://isaactpetersen.github.io/QuartoReprexForEdit/#sec-quarto
Steps to reproduce
Here is a link to a reproducible example:
https://isaactpetersen.github.io/QuartoReprexForEdit/ (archived at https://perma.cc/Q5ZS-BP4E)
Here is the code that generates the reproducible example:
https://github.com/isaactpetersen/QuartoReprexForEdit/blob/main/index.qmd
Here is the output:
# Load libraries
library("mice")
#>
#> Attaching package: 'mice'
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following objects are masked from 'package:base':
#>
#> cbind, rbind
# Impute data
imp <- mice::mice(
nhanes,
maxit = 2,
m = 2)
#>
#> iter imp variable
#> 1 1 bmi hyp chl
#> 1 2 bmi hyp chl
#> 2 1 bmi hyp chl
#> 2 2 bmi hyp chl
# Fit regression model to multiply imputed data
fit <- with(
data = imp,
exp = lm(bmi ~ hyp + chl))
# Pool results across models
fit_pooled <- mice::pool(fit)
# Summarize pooled results
fit_pooled
Warning in `[<-.data.frame`(`*tmp*`, is_list, value = list(`3` = "<df[,11] [0 ×
11]>", : replacement element 1 has 1 row to replace 0 rows
Warning in `[<-.data.frame`(`*tmp*`, is_list, value = list(`3` = "<df[,11] [0 ×
11]>", : replacement element 2 has 1 row to replace 0 rows
Error:
! arguments imply differing number of rows: 1, 0
summary(fit_pooled)
#> term estimate std.error statistic df p.value
#> 1 (Intercept) 23.5653619 4.58749728 5.136867 20.222496 4.858105e-05
#> 2 hyp -2.6735267 2.23416369 -1.196657 9.102038 2.616789e-01
#> 3 chl 0.0350338 0.02406278 1.455933 18.483798 1.621871e-01
# Session Info
sessionInfo()
#> R version 4.5.2 (2025-10-31)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 24.04.3 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
#> [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
#> [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
#> [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] mice_3.19.0
#>
#> loaded via a namespace (and not attached):
#> [1] generics_0.1.4 tidyr_1.3.2 shape_1.4.6.1 lattice_0.22-7
#> [5] lme4_1.1-38 digest_0.6.39 magrittr_2.0.4 mitml_0.4-5
#> [9] evaluate_1.0.5 grid_4.5.2 iterators_1.0.14 fastmap_1.2.0
#> [13] foreach_1.5.2 jomo_2.7-6 glmnet_4.1-10 Matrix_1.7-4
#> [17] nnet_7.3-20 backports_1.5.0 survival_3.8-3 purrr_1.2.0
#> [21] codetools_0.2-20 reformulas_0.4.3.1 Rdpack_2.6.4 cli_3.6.5
#> [25] rlang_1.1.6 rbibutils_2.4 splines_4.5.2 reprex_2.1.1
#> [29] withr_3.0.2 yaml_2.3.12 pan_1.9 tools_4.5.2
#> [33] nloptr_2.2.1 minqa_1.2.8 dplyr_1.1.4 boot_1.3-32
#> [37] broom_1.0.11 vctrs_0.6.5 R6_2.6.1 rpart_4.1.24
#> [41] lifecycle_1.0.5 fs_1.6.6 MASS_7.3-65 pkgconfig_2.0.3
#> [45] pillar_1.11.1 glue_1.8.0 Rcpp_1.1.0 xfun_0.55
#> [49] tibble_3.3.0 tidyselect_1.2.1 knitr_1.51 htmltools_0.5.9
#> [53] nlme_3.1-168 rmarkdown_2.30 compiler_4.5.2Actual behavior
Error:
Warning in `[<-.data.frame`(`*tmp*`, is_list, value = list(`3` = "<df[,11] [0 ×
11]>", : replacement element 1 has 1 row to replace 0 rows
Warning in `[<-.data.frame`(`*tmp*`, is_list, value = list(`3` = "<df[,11] [0 ×
11]>", : replacement element 2 has 1 row to replace 0 rows
Error:
! arguments imply differing number of rows: 1, 0Expected behavior
Display the object without error
Your environment
- IDE: none used for GitHub Actions
- OS: Ubuntu 24.04.3 LTS
Quarto check output
quarto --version
quarto check
shell: /usr/bin/bash -e {0}
env:
BUNDLE_EXT: linux-amd64.deb
1.8.26
Quarto 1.8.26
[✓] Checking environment information...
Quarto cache location: /home/runner/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.6.3: OK
Dart Sass version 1.87.0: OK
Deno version 2.3.1: OK
Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.8.26
Path: /opt/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Tex: (not detected)
[✓] Checking Chrome Headless....................OK
Using: Chrome found on system
Path: /usr/bin/google-chrome
Source: PATH
(|) Checking basic markdown render....
[✓] Checking basic markdown render....OK
(|) Checking Python 3 installation....
[✓] Checking Python 3 installation....OK
Version: 3.12.3
Path: /usr/bin/python3
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
There is a requirements.txt file in this directory. Is this for a venv that you need to restore?
[✓] Checking R installation...........(None)
Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/