Skip to content
This repository was archived by the owner on Feb 10, 2026. It is now read-only.

Commit 4485929

Browse files
committed
Change example so it doesn't open browser during R CMD check
1 parent ce39f44 commit 4485929

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

R/print.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,16 @@ print.ggvis <- function(x, dynamic = NA, launch = interactive(), ...) {
6464
#' @param plot_id Unique identifier used to identify the plot on the page.
6565
#' @param dest Deprecated (this no longer works).
6666
#' @examples
67+
#' ## Run these examples only in interactive R sessions
68+
#' if (interactive()) {
6769
#' # In most cases view_static is unnecessary; these will do the same thing:
6870
#' mtcars %>% ggvis(~wt, ~mpg)
6971
#' mtcars %>% ggvis(~wt, ~mpg) %>% view_static()
7072
#'
7173
#' # Can find the output file with view_static() and html_print()
7274
#' outfile <- mtcars %>% ggvis(~wt, ~mpg) %>%
7375
#' view_static() %>% htmltools::html_print(viewer = NULL)
76+
#' }
7477
view_static <- function(x, plot_id = rand_id("plot_"), dest = NULL) {
7578

7679

man/print.ggvis.Rd

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)