Skip to content

Commit

Permalink
fix vigmnette
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 13, 2023
1 parent fa7a078 commit 501707c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
9 changes: 4 additions & 5 deletions R/plot.visualisation_recipe.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ plot.see_visualisation_recipe <- function(x, ...) {
if (!"ggraph" %in% .packages()) {
attachNamespace("ggraph") # Needs to be attached
}
ggraph::ggraph(attributes(x)$data, layout = attributes(x)$layout) +
geoms_from_list(x)
suppressWarnings(ggraph::ggraph(attributes(x)$data, layout = attributes(x)$layout) +
geoms_from_list(x))
} else {
ggplot2::ggplot(data = attributes(x)$data) +
geoms_from_list(x, ...)
suppressWarnings(ggplot2::ggplot(data = attributes(x)$data) + geoms_from_list(x, ...))
}
}

Expand All @@ -23,7 +22,7 @@ plot.see_visualisation_recipe <- function(x, ...) {
plot.see_visualisation_recipes <- function(x, ...) {
the_plots <- list()
for (i in names(x)) {
the_plots[[i]] <- graphics::plot(x[[i]])
the_plots[[i]] <- suppressWarnings(graphics::plot(x[[i]]))
}
pw <- plots(the_plots, ...)
.safe_print_plots(pw)
Expand Down
10 changes: 8 additions & 2 deletions vignettes/modelbased.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,17 @@ plot(result)
```


```{r slopes-poly}
```{r slopes-poly, echo=TRUE, eval=FALSE}
model <- lm(Petal.Length ~ Species * poly(Sepal.Width, 3), data = iris)
result <- estimate_slopes(model, at = c("Sepal.Width", "Species"))
suppressWarnings(plot(result))
plot(result)
```
```{r slopes-poly2, eval=can_evaluate, echo=FALSE}
model <- lm(Petal.Length ~ Species * poly(Sepal.Width, 3), data = iris)
result <- estimate_slopes(model, at = c("Sepal.Width", "Species"))
suppressWarnings(print(plot(result)))
```

# Estimate derivatives
Expand Down

0 comments on commit 501707c

Please sign in to comment.