Skip to content

Commit

Permalink
Use the vectorization power of rlang::is_installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Oct 16, 2023
1 parent afcf701 commit b6f5382
Show file tree
Hide file tree
Showing 26 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion R/db-interface.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#' @return A `dm` object on the given `src` with the same table names
#' as the input `dm`.
#'
#' @examplesIf rlang::is_installed("RSQLite") && rlang::is_installed("nycflights13") && rlang::is_installed("dbplyr")
#' @examplesIf rlang::is_installed(c("RSQLite", "nycflights13", "dbplyr"))
#' con <- DBI::dbConnect(RSQLite::SQLite())
#'
#' # Copy to temporary tables, unique table names by default:
Expand Down
2 changes: 1 addition & 1 deletion R/descriptions.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' @return For `dm_set_table_description()`: A `dm` object containing descriptions for specified tables.
#' @export
#'
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("labelled") && rlang::is_installed("DiagrammeR")
#' @examplesIf rlang::is_installed(c("nycflights13", "labelled", "DiagrammeR"))
#' desc_flights <- rlang::set_names(
#' "flights",
#' paste(
Expand Down
2 changes: 1 addition & 1 deletion R/dm.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#' new_dm(list(trees = trees, mtcars = mtcars))
#'
#' as_dm(list(trees = trees, mtcars = mtcars))
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("dbplyr")
#' @examplesIf rlang::is_installed(c("nycflights13", "dbplyr"))
#'
#' is_dm(dm_nycflights13())
#'
Expand Down
2 changes: 1 addition & 1 deletion R/dm_sql.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#' @return Nested list of SQL statements.
#'
#' @export
#' @examplesIf rlang::is_installed("RSQLite") && rlang::is_installed("dbplyr")
#' @examplesIf rlang::is_installed(c("RSQLite", "dbplyr"))
#' con <- DBI::dbConnect(RSQLite::SQLite())
#' dm <- dm_nycflights13()
#' s <- dm_sql(dm, con)
Expand Down
4 changes: 2 additions & 2 deletions R/draw-dm.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#' Currently, this is an object of class `grViz` (see also
#' [DiagrammeR::grViz()]), but this is subject to change.
#'
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' @examplesIf rlang::is_installed(c("nycflights13", "DiagrammeR"))
#' dm_nycflights13() %>%
#' dm_draw()
#'
Expand Down Expand Up @@ -237,7 +237,7 @@ dm_get_all_column_types <- function(x) {
#' @return For `dm_set_colors()`: the updated data model.
#'
#' @export
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' @examplesIf rlang::is_installed(c("nycflights13", "DiagrammeR"))
#' dm_nycflights13(color = FALSE) %>%
#' dm_set_colors(
#' darkblue = starts_with("air"),
Expand Down
2 changes: 1 addition & 1 deletion R/filter-dm.R
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ dm_get_filtered_table <- function(dm, from) {
#' \item{`zoomed`}{logical, does the filter condition relate to the zoomed table.}
#' }
#'
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("dbplyr")
#' @examplesIf rlang::is_installed(c("nycflights13", "dbplyr"))
#' dm_nycflights13() %>%
#' dm_get_filters()
#' @noRd
Expand Down
4 changes: 2 additions & 2 deletions R/foreign-keys.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#' @return An updated `dm` with an additional foreign key relation.
#'
#' @export
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' @examplesIf rlang::is_installed(c("nycflights13", "DiagrammeR"))
#' nycflights_dm <- dm(
#' planes = nycflights13::planes,
#' flights = nycflights13::flights,
Expand Down Expand Up @@ -304,7 +304,7 @@ dm_get_all_fks_def_impl <- function(def, parent_table = NULL, ignore_on_delete =
#' @return An updated `dm` without the matching foreign key relation(s).
#'
#' @export
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' @examplesIf rlang::is_installed(c("nycflights13", "DiagrammeR"))
#' dm_nycflights13(cycle = TRUE) %>%
#' dm_rm_fk(flights, dest, airports) %>%
#' dm_draw()
Expand Down
2 changes: 1 addition & 1 deletion R/pixarfilms.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#'
#' @export
#' @autoglobal
#' @examplesIf rlang::is_installed("pixarfilms") && rlang::is_installed("DiagrammeR")
#' @examplesIf rlang::is_installed(c("pixarfilms", "DiagrammeR"))
#' dm_pixarfilms()
#' dm_pixarfilms() %>%
#' dm_draw()
Expand Down
4 changes: 2 additions & 2 deletions R/primary-keys.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#'
#' @return An updated `dm` with an additional primary key.
#'
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' @examplesIf rlang::is_installed(c("nycflights13", "DiagrammeR"))
#' nycflights_dm <- dm(
#' planes = nycflights13::planes,
#' airports = nycflights13::airports,
Expand Down Expand Up @@ -239,7 +239,7 @@ dm_get_all_pks_def_impl <- function(def, table = NULL) {
#' @return An updated `dm` without the indicated primary key(s).
#'
#' @export
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' @examplesIf rlang::is_installed(c("nycflights13", "DiagrammeR"))
#' dm_nycflights13() %>%
#' dm_rm_pk(airports) %>%
#' dm_draw()
Expand Down
2 changes: 1 addition & 1 deletion R/rows-dm.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#' and `x` is returned, invisibly.
#'
#' @name rows-dm
#' @examplesIf rlang::is_installed("RSQLite") && rlang::is_installed("nycflights13") && rlang::is_installed("dbplyr")
#' @examplesIf rlang::is_installed(c("RSQLite", "nycflights13", "dbplyr"))
#' # Establish database connection:
#' sqlite <- DBI::dbConnect(RSQLite::SQLite())
#'
Expand Down
2 changes: 1 addition & 1 deletion R/unique-keys.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#'
#' @return An updated `dm` with an additional unqiue key.
#'
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' @examplesIf rlang::is_installed(c("nycflights13", "DiagrammeR"))
#'
#' nycflights_dm <- dm(
#' planes = nycflights13::planes,
Expand Down
2 changes: 1 addition & 1 deletion R/zoom.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#' @return For `dm_zoom_to()`: A `dm_zoomed` object.
#'
#' @export
#' @examplesIf rlang::is_installed("nycflights13") && rlang::is_installed("DiagrammeR")
#' @examplesIf rlang::is_installed(c("nycflights13", "DiagrammeR"))
#' flights_zoomed <- dm_zoom_to(dm_nycflights13(), flights)
#'
#' flights_zoomed
Expand Down
2 changes: 1 addition & 1 deletion man/copy_dm_to.Rd

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

2 changes: 1 addition & 1 deletion man/dm.Rd

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

2 changes: 1 addition & 1 deletion man/dm_add_fk.Rd

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

2 changes: 1 addition & 1 deletion man/dm_add_pk.Rd

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

2 changes: 1 addition & 1 deletion man/dm_add_uk.Rd

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

2 changes: 1 addition & 1 deletion man/dm_draw.Rd

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

2 changes: 1 addition & 1 deletion man/dm_pixarfilms.Rd

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

2 changes: 1 addition & 1 deletion man/dm_rm_fk.Rd

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

2 changes: 1 addition & 1 deletion man/dm_rm_pk.Rd

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

2 changes: 1 addition & 1 deletion man/dm_set_colors.Rd

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

2 changes: 1 addition & 1 deletion man/dm_set_table_description.Rd

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

2 changes: 1 addition & 1 deletion man/dm_sql.Rd

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

2 changes: 1 addition & 1 deletion man/dm_zoom_to.Rd

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

2 changes: 1 addition & 1 deletion man/rows-dm.Rd

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

0 comments on commit b6f5382

Please sign in to comment.