Closed andrewheiss closed 2 months ago
Interesting. There seem to be two issues.
rstudioapi
incorrectly detects RStudio when running in PositronI believe this is a straightforward bug, and I have reported it upstream here: https://github.com/rstudio/rstudioapi/issues/302
Until this gets fixed, I implemented error catching when trying to opening the RStudio viewer in a different IDE. If this fails, print.tinytable()
will keep going and launch a browser.
In VSCode, launching this kind of browser usually embeds the HTML in a dedicated pane inside the IDE. (Assuming you have some kind of local server extension installed.)
In Positron, this seems to launch a separate browser window (on my machine).
rstudioapi::viewer()
is not implemented for Positron.This is a known issue, and I hope the Positron team will offer this feature, because it feels quite important to me. Here's the ticket:
https://github.com/posit-dev/positron/issues/2559
gt
do?I have no idea. Would be very interested in learning about their solution!
@vincentarelbundock Both VSCode and Positron expose options("viewer")$viewer
which accepts a url for html. In fact, gt
uses htmltools::html_print
which uses viewer = getOption("viewer", utils::browseURL)
Edit: RStudio has this too: https://github.com/rstudio/rstudio/blob/d2713874570f06dccc92a46d15e5939922817c7b/src/cpp/r/R/Options.R#L29
Thanks for the suggestion @kylebutts . I'll look into that when I find some time.
Note: Posit recommends rstudioapi::hasFun("viewer")
https://github.com/rstudio/rstudioapi/issues/302#issuecomment-2211418452
@andrewheiss , FYI, @kylebutts is a superstar and just fixed this for us. His PR is merged and tiny tables appear as expected in the Viewer Pane in my local Positron.
Yay!
The first Positron-related issue!
In Positron (but not VS Code, weirdly), {tinytable} tables don't appear in the preview window and instead cause an error:
Here's a reprex:
This doesn't :(