hafen / trelliscopejs

TrelliscopeJS R Package
https://hafen.github.io/trelliscopejs
Other
263 stars 37 forks source link

trelliscope in HTML presentation produces error #11

Closed Emaasit closed 7 years ago

Emaasit commented 7 years ago

I tried putting an output from this package into an HTML presentation

```{r, warning = FALSE, message = FALSE, eval = TRUE}
d <- mpg %>%
  group_by(manufacturer, class) %>%
  summarise(
    panel = panel(
      qplot(cty, hwy) + xlab("cty") + ylab("hwy") +
        xlim(7, 37) + ylim(9, 47) + theme_bw())) %>%
  trelliscope(name = "dplyr_gg", self_contained = TRUE)
d
`

But got this error:

Error in if (!grepl("^[A-Za-z0-9_]", orig_path)) stop_nice("Path for trelliscope output while inside knitr must be relative.") : argument is of length zero Calls: ... trelliscope -> trelliscope.data.frame -> resolve_app_params Execution halted

Emaasit commented 7 years ago

Looks like it works when you add the "path" argument in trelliscope. Like this:

```{r, warning = FALSE, message = FALSE, eval = TRUE}
d <- mpg %>%
group_by(manufacturer, class) %>%
summarise(
panel = panel(
qplot(cty, hwy) + xlab("cty") + ylab("hwy") +
xlim(7, 37) + ylim(9, 47) + theme_bw())) %>%
trelliscope(name = "dplyr_gg", self_contained = TRUE, path = "mydisplays")
d