esquisse
esquisse copied to clipboard
Running `esquisser(my_data)` in an R Notebook (with inline output) works, but shows traceback errors.
RStudio 2021.09.2 Build 382
R 4.1.2
esquisse
1.1.0
To reproduce:
- Start a new R notebook from RStudio.
- In any chunk run
esquisse::esquisser(cars)
. - Create a figure (e.g.
speed
in x anddist
in y) - Exit the GUI.
The chunk output shows the following:
Listening on http://127.0.0.1:7454
Error in get(GeomFun, envir = pkg_envir) :
object 'GeomHistogram' not found
Error in get(GeomFun, envir = pkg_envir) :
object 'GeomHistogram' not found
(Yes, it shows the error twice.)
I know this "bug" may be more about how RStudio is handling the output than esquisse
directly, but in an issue handling readr
behavior in notebook chunks, the solution was to add a check for the notebook environment (https://github.com/tidyverse/readr/issues/793), e.g. below. Not sure if this can be applied in this case.
!isTRUE(getOption("rstudio.notebook.executing")) && # Not running in an RStudio notebook chunk
!isTRUE(getOption("knitr.in.progress")) # Not actively knitting a document
Having esquisse::esquisser(cars)
in a chunk also seems to hang the knitting process. For now my recommendation to my students is to run the esquisse GUI via the Add-in or the console and leave it out of the notebook.