r-lib / asciicast

Turn R scripts into terminal screencasts
https://asciicast.r-lib.org/
Other
226 stars 11 forks source link

Missing output with `vctrs` classes #50

Closed mccarthy-m-g closed 2 years ago

mccarthy-m-g commented 2 years ago

asciicast does not include all output for vctrs classes. Specifically, it doesn't include the line displaying the class. Here's an R Markdown reprex, along with the output.

---
title: "reprex"
output: github_document
always_allow_html: true
---

```{r, include = FALSE, cache = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  cache = FALSE,
  asciicast_theme = "pkgdown"
)
asciicast::init_knitr_engine(
  echo = TRUE,
  echo_input = FALSE
)

asciicast does not include all output for vctrs classes. For example, if we run the following in an r code chunk we get:

library(clock)
x <- year_month_day(2019, 2, 1)
add_months(x, 1)

But the asciicast code chunk does not include the first line containing <year_month_day<day>[1]>:

library(clock)
x <- year_month_day(2019, 2, 1)
add_months(x, 1)


![Screen Shot 2022-11-25 at 1 28 41 PM](https://user-images.githubusercontent.com/51542091/204057017-44f33497-1f91-4214-bf42-d2176dfbe263.png)
gaborcsardi commented 2 years ago

I cannot reproduce this with asciicast 2.2.1 on macOS. Can you tell us more about your system? E.g. sessioninfo::session_info()?

mccarthy-m-g commented 2 years ago

This must have been fixed recently. I just updated asciicast to 2.2.1 and it now works as expected. Thanks!

Here's my session info before I updated for posterity:

─ Session info ────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.1.1 (2021-08-10)
 os       macOS Mojave 10.14.6
 system   x86_64, darwin17.0
 ui       RStudio
 language (EN)
 collate  en_CA.UTF-8
 ctype    en_CA.UTF-8
 tz       America/Vancouver
 date     2022-11-25
 rstudio  2021.09.2+382 Ghost Orchid (desktop)
 pandoc   2.11 @ /Users/Michael/Library/r-miniconda/envs/r-reticulate-mne/bin/pandoc

─ Packages ────────────────────────────────────────────────────────────────────────────────
 package     * version    date (UTC) lib source
 asciicast   * 2.1.0      2022-08-07 [1] CRAN (R 4.1.2)
 cachem        1.0.6      2021-08-19 [1] CRAN (R 4.1.0)
 callr         3.7.0      2021-04-20 [1] CRAN (R 4.1.0)
 cli           3.4.1      2022-09-23 [1] CRAN (R 4.1.2)
 crayon        1.5.1      2022-03-26 [1] CRAN (R 4.1.2)
 curl          4.3        2019-12-02 [2] CRAN (R 4.1.0)
 devtools    * 2.4.5      2022-10-11 [1] CRAN (R 4.1.2)
 digest        0.6.29     2021-12-01 [1] CRAN (R 4.1.0)
 ellipsis      0.3.2      2021-04-29 [1] CRAN (R 4.1.0)
 fastmap       1.1.0      2021-01-25 [1] CRAN (R 4.1.0)
 fs            1.5.2      2021-12-08 [1] CRAN (R 4.1.0)
 glue          1.6.2      2022-02-24 [1] CRAN (R 4.1.2)
 htmltools     0.5.3      2022-07-18 [1] CRAN (R 4.1.2)
 htmlwidgets   1.5.4      2021-09-08 [1] CRAN (R 4.1.0)
 httpuv        1.6.5      2022-01-05 [1] CRAN (R 4.1.2)
 jsonlite      1.8.0      2022-02-22 [1] CRAN (R 4.1.2)
 later         1.3.0      2021-08-18 [1] CRAN (R 4.1.0)
 lifecycle     1.0.1      2021-09-24 [1] CRAN (R 4.1.0)
 magick        2.7.3      2021-08-18 [1] CRAN (R 4.1.0)
 magrittr      2.0.3      2022-03-30 [1] CRAN (R 4.1.2)
 memoise       2.0.1      2021-11-26 [1] CRAN (R 4.1.0)
 mime          0.12       2021-09-28 [1] CRAN (R 4.1.0)
 miniUI        0.1.1.1    2018-05-18 [1] CRAN (R 4.1.0)
 pkgbuild      1.3.1      2021-12-20 [1] CRAN (R 4.1.0)
 pkgload       1.3.0      2022-06-27 [1] CRAN (R 4.1.2)
 prettyunits   1.1.1      2020-01-24 [1] CRAN (R 4.1.0)
 processx      3.7.0      2022-07-07 [1] CRAN (R 4.1.2)
 profvis       0.3.7      2020-11-02 [1] CRAN (R 4.1.0)
 promises      1.2.0.1    2021-02-11 [1] CRAN (R 4.1.0)
 ps            1.6.0      2021-02-28 [1] CRAN (R 4.1.0)
 purrr         0.3.4      2020-04-17 [1] CRAN (R 4.1.0)
 R6            2.5.1      2021-08-19 [1] CRAN (R 4.1.0)
 Rcpp          1.0.8.3    2022-03-17 [1] CRAN (R 4.1.2)
 rdocsyntax    0.6.2.9000 2022-04-12 [1] Github (kiendang/rdocsyntax@6e016c8)
 remotes       2.4.2      2021-11-30 [1] CRAN (R 4.1.0)
 rlang         1.0.6      2022-09-24 [1] CRAN (R 4.1.2)
 rsthemes      0.3.1      2022-04-12 [1] Github (gadenbuie/rsthemes@bbe73ca)
 rstudioapi    0.13       2020-11-12 [1] CRAN (R 4.1.0)
 sessioninfo   1.2.2      2021-12-06 [1] CRAN (R 4.1.0)
 shiny         1.7.1      2021-10-02 [1] CRAN (R 4.1.0)
 stringi       1.7.6      2021-11-29 [1] CRAN (R 4.1.0)
 stringr       1.4.0      2019-02-10 [1] CRAN (R 4.1.0)
 urlchecker    1.0.1      2021-11-30 [1] CRAN (R 4.1.0)
 usethis     * 2.1.6      2022-05-25 [1] CRAN (R 4.1.2)
 V8            4.1.0      2022-02-06 [1] CRAN (R 4.1.2)
 xml2          1.3.3      2021-11-30 [1] CRAN (R 4.1.0)
 xtable        1.8-4      2019-04-21 [1] CRAN (R 4.1.0)

 [1] /Users/Michael/Library/R/4.1/library
 [2] /Library/Frameworks/R.framework/Versions/4.1/Resources/library

───────────────────────────────────────────────────────────────────────────────────────────