gtsave() ignores path argument, only saving to tempdir()

R v4.1.2, gt v0.4.0.

Any time I use gtsave(), the arguments filename and path seem to be outright ignored.

The following code is an example of what I implement:


gtcars %>%
  gt(rowname_col = "model") %>%
  gtsave(
    filename = "gtcars.html",
    path = "~/My_Project/output/"
  )

I found that there are files created in the filepath listed when I use tempdir().

Am I missing something with the implementation?

When it fails for you, does it do so silently, or does it print an error to the console ?

one thing to try is path.expand() around your path string

gtcars %>%
  gt(rowname_col = "model") %>%
  gtsave(
    filename = "gtcars.html",
    path = path.expand("~/My_Project/output/")
  )

I receive no warning or error message in the console, so it seemed the function works correctly.

Explicitly declaring the path worked or wrapping the path argument with path.expand() worked.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.