Skip to content

Table previews don't appear in Positron #298

Closed
@andrewheiss

Description

@andrewheiss

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:

Error:
! Function viewer not found in RStudio
Hide Traceback
    ▆
 1. ├─methods (local) `<stndrdGn>`(`<tinytabl[,5]>`)
 2. └─tinytable (local) `<stndrdGn>`(`<tinytabl[,5]>`)
 3.   └─tinytable:::print.tinytable(...)
 4.     └─rstudioapi::viewer(htmlFile)
 5.       └─rstudioapi::callFun("viewer", url, height = height)

Here's a reprex:

This works

```{r}
library(gt)

mtcars[1:5, 1:5] |>
  gt()
```

This doesn't :(

```{r}
library(tinytable)

mtcars[1:5, 1:5] |>
  tt()
```
image

 

It seems like print.tinytable() is trying to use rstudioapi::viewer() inside Positron? In VS Code, print.tinytable() doesn't try to use {rstudioapi} and instead shows the table in the Viewer tab, as expected:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions