Skip to content

Commit

Permalink
Use more examplesIf, r-lib/roxygen2#993
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jul 2, 2020
1 parent 9a38a7c commit 7c1a8e5
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 14 deletions.
7 changes: 4 additions & 3 deletions R/draw-dm.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @return For `dm_draw()`: returns an object of class `grViz` (see also [DiagrammeR::grViz()]), which,
#' when printed, produces the output seen in the viewer as a side effect.
#'
#' @examples
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' dm_nycflights13() %>%
#' dm_draw()
#'
Expand Down Expand Up @@ -131,7 +131,9 @@ dm_get_all_columns <- function(x) {
#' @return For `dm_set_colors()`: the updated data model.
#'
#' @rdname dm_draw
#' @examples
#'
#' @export
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#'
#' dm_nycflights13(color = FALSE) %>%
#' dm_set_colors(
Expand All @@ -149,7 +151,6 @@ dm_get_all_columns <- function(x) {
#' dm_nycflights13(color = FALSE) %>%
#' dm_set_colors(!!!nyc_cols) %>%
#' dm_draw()
#' @export
dm_set_colors <- function(dm, ...) {
quos <- enquos(...)
if (any(names(quos) == "")) abort_only_named_args("dm_set_colors", "the colors")
Expand Down
5 changes: 2 additions & 3 deletions R/foreign-keys.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' @return For `dm_add_fk()`: An updated `dm` with an additional foreign key relation.
#'
#' @export
#' @examplesIf rlang::is_installed("nycflights13")
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' nycflights_dm <- dm(
#' planes = nycflights13::planes,
#' flights = nycflights13::flights
Expand Down Expand Up @@ -212,8 +212,7 @@ dm_get_all_fks_impl <- function(dm) {
#' @return For `dm_rm_fk()`: An updated `dm` without the given foreign key relation.
#'
#' @export
#' @examples
#'
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' dm_nycflights13(cycle = TRUE) %>%
#' dm_rm_fk(flights, dest, airports) %>%
#' dm_draw()
Expand Down
5 changes: 2 additions & 3 deletions R/primary-keys.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#' @return For `dm_add_pk()`: An updated `dm` with an additional primary key.
#'
#' @export
#' @examplesIf rlang::is_installed("nycflights13")
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' nycflights_dm <- dm(
#' planes = nycflights13::planes,
#' airports = nycflights13::airports
Expand Down Expand Up @@ -208,8 +208,7 @@ dm_get_all_pks_impl <- function(dm) {
#'
#' @return For `dm_rm_pk()`: An updated `dm` without the indicated primary key.
#'
#' @examples
#'
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' dm_nycflights13() %>%
#' dm_rm_pk(airports, rm_referencing_fks = TRUE) %>%
#' dm_draw()
Expand Down
2 changes: 1 addition & 1 deletion R/zoom.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#' @return For `dm_zoom_to()`: A `zoomed_dm` object.
#'
#' @export
#' @examples
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' flights_zoomed <- dm_zoom_to(dm_nycflights13(), flights)
#'
#' flights_zoomed
Expand Down
5 changes: 3 additions & 2 deletions man/dm_add_fk.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/dm_add_pk.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/dm_draw.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/dm_zoom_to.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7c1a8e5

Please sign in to comment.