Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative path error when creating trelliscope visualization from R Markdown #104

Open
kaneplusplus opened this issue Jan 3, 2021 · 1 comment

Comments

@kaneplusplus
Copy link
Contributor

Please note that this appears to be related to, but not quite the same as, issue #13. The following R Markdown header:

---
title: "Trelliscope Test"
output: 
  html_document:
    self_contained: no
---

with the body

library(ggplot2)
library(trelliscopejs)
library(tidyr)
library(dplyr)
library(purrr)

iris %>% 
  nest(data = -Species) %>%
  mutate(panel_col = map(data, ~ ggplot(.x, aes(x = Sepal.Length, y = Sepal.Width)) + geom_point())) %>%
  trelliscope(name = "iris-test", panel_col = "panel_col", path = "../iris-test", self_contained = TRUE) 

Gives the error:

Error: Path for trelliscope output while inside knitr or Shiny must be
       relative.

Please note that the trelliscope output path provided "../iris-test" is relative.

@kaneplusplus
Copy link
Contributor Author

As a follow up, it looks like the error emanates from helpers.R, line 105. The grep() statement on 104 defines a relative path as one that starts with a letter, number, or underscore.

Are there constraints on the construction of a trelliscope object such that it has to be within orig_path? If not, {xfun} has a function, is_abs_path() that could be used directly or would be a good basis for a replacement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant