diff --git a/R/01-DBIObject.R b/R/01-DBIObject.R index 56068a0b1..9be5f4a86 100644 --- a/R/01-DBIObject.R +++ b/R/01-DBIObject.R @@ -31,7 +31,7 @@ NULL #' #' @docType class #' @family DBI classes -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' drv <- RSQLite::SQLite() #' con <- dbConnect(drv) #' diff --git a/R/03-DBIConnection.R b/R/03-DBIConnection.R index 81b39563b..338c0fa0b 100644 --- a/R/03-DBIConnection.R +++ b/R/03-DBIConnection.R @@ -12,7 +12,7 @@ #' @name DBIConnection-class #' @family DBI classes #' @family DBIConnection generics -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' con #' dbDisconnect(con) diff --git a/R/11-dbAppendTable.R b/R/11-dbAppendTable.R index 7daf358f0..b23faf37f 100644 --- a/R/11-dbAppendTable.R +++ b/R/11-dbAppendTable.R @@ -28,7 +28,7 @@ #' #' @family DBIConnection generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' dbCreateTable(con, "iris", iris) #' dbAppendTable(con, "iris", iris) diff --git a/R/12-dbCreateTable.R b/R/12-dbCreateTable.R index d3ed9b1d9..15e669971 100644 --- a/R/12-dbCreateTable.R +++ b/R/12-dbCreateTable.R @@ -27,7 +27,7 @@ #' #' @family DBIConnection generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' dbCreateTable(con, "iris", iris) #' dbReadTable(con, "iris") diff --git a/R/13-dbWriteTable.R b/R/13-dbWriteTable.R index 919728360..fb499b2fc 100644 --- a/R/13-dbWriteTable.R +++ b/R/13-dbWriteTable.R @@ -28,7 +28,7 @@ #' For `dbWriteTableArrow()`, an object coercible to an Arrow RecordBatchReader. #' @family DBIConnection generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "mtcars", mtcars[1:5, ]) diff --git a/R/DBI-package.R b/R/DBI-package.R index 18e9477e5..72b60687c 100644 --- a/R/DBI-package.R +++ b/R/DBI-package.R @@ -8,7 +8,7 @@ #' @inheritSection DBItest::spec_compliance_methods DBI classes and methods #' @inheritSection DBItest::spec_driver_constructor Construction of the DBIDriver object #' -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' RSQLite::SQLite() #' @seealso #' Important generics: [dbConnect()], [dbGetQuery()], diff --git a/R/DBIConnector.R b/R/DBIConnector.R index ef765593e..7606fcfb0 100644 --- a/R/DBIConnector.R +++ b/R/DBIConnector.R @@ -25,7 +25,7 @@ NULL #' @family DBI classes #' @family DBIConnector generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' # Create a connector: #' cnr <- new("DBIConnector", #' .drv = RSQLite::SQLite(), diff --git a/R/dbBind.R b/R/dbBind.R index 012b607bf..a0f6e46e7 100644 --- a/R/dbBind.R +++ b/R/dbBind.R @@ -104,7 +104,7 @@ #' @family data retrieval generics #' @family command execution generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "iris", iris) diff --git a/R/dbCanConnect.R b/R/dbCanConnect.R index 0de0f0f8f..8a4f9e85e 100644 --- a/R/dbCanConnect.R +++ b/R/dbCanConnect.R @@ -14,7 +14,7 @@ #' @inheritParams dbConnect #' @family DBIDriver generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' # SQLite only needs a path to the database. (Here, ":memory:" is a special #' # path that creates an in-memory database.) Other database drivers #' # will require more details (like user, password, host, port, etc.) diff --git a/R/dbClearResult.R b/R/dbClearResult.R index 46902651c..0822c15fa 100644 --- a/R/dbClearResult.R +++ b/R/dbClearResult.R @@ -20,7 +20,7 @@ #' @family data retrieval generics #' @family command execution generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' rs <- dbSendQuery(con, "SELECT 1") diff --git a/R/dbColumnInfo.R b/R/dbColumnInfo.R index c5d1dc4bb..ac28ed900 100644 --- a/R/dbColumnInfo.R +++ b/R/dbColumnInfo.R @@ -18,7 +18,7 @@ #' #' @family DBIResult generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' rs <- dbSendQuery(con, "SELECT 1 AS a, 2 AS b") diff --git a/R/dbConnect.R b/R/dbConnect.R index e660f253e..c05151cec 100644 --- a/R/dbConnect.R +++ b/R/dbConnect.R @@ -24,7 +24,7 @@ #' @family DBIDriver generics #' @family DBIConnector generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' # SQLite only needs a path to the database. (Here, ":memory:" is a special #' # path that creates an in-memory database.) Other database drivers #' # will require more details (like user, password, host, port, etc.) diff --git a/R/dbDataType.R b/R/dbDataType.R index cdfda985e..07f5b6bfd 100644 --- a/R/dbDataType.R +++ b/R/dbDataType.R @@ -45,6 +45,7 @@ #' dbDataType(ANSI(), I(3)) #' #' dbDataType(ANSI(), iris) +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' diff --git a/R/dbDisconnect.R b/R/dbDisconnect.R index bf104efb0..0e637dd1a 100644 --- a/R/dbDisconnect.R +++ b/R/dbDisconnect.R @@ -12,7 +12,7 @@ #' @inheritParams dbGetQuery #' @family DBIConnection generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' dbDisconnect(con) setGeneric("dbDisconnect", diff --git a/R/dbDriver.R b/R/dbDriver.R index 597e9da34..f35210317 100644 --- a/R/dbDriver.R +++ b/R/dbDriver.R @@ -31,7 +31,7 @@ #' @family DBIDriver generics #' @export #' @keywords internal -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' # Create a RSQLite driver with a string #' d <- dbDriver("SQLite") #' d diff --git a/R/dbExecute.R b/R/dbExecute.R index afd3090ce..ab5068f1a 100644 --- a/R/dbExecute.R +++ b/R/dbExecute.R @@ -33,7 +33,7 @@ #' @family command execution generics #' @seealso For queries: [dbSendQuery()] and [dbGetQuery()]. #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "cars", head(cars, 3)) diff --git a/R/dbExistsTable.R b/R/dbExistsTable.R index bce1bc52c..a1ebf7622 100644 --- a/R/dbExistsTable.R +++ b/R/dbExistsTable.R @@ -12,7 +12,7 @@ #' @inheritParams dbReadTable #' @family DBIConnection generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbExistsTable(con, "iris") diff --git a/R/dbFetch.R b/R/dbFetch.R index 95ff91491..71862e3c2 100644 --- a/R/dbFetch.R +++ b/R/dbFetch.R @@ -29,7 +29,7 @@ #' finish retrieving the records you want. #' @family DBIResult generics #' @family data retrieval generics -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "mtcars", mtcars) diff --git a/R/dbGetConnectArgs.R b/R/dbGetConnectArgs.R index bc3f5f292..95c823e86 100644 --- a/R/dbGetConnectArgs.R +++ b/R/dbGetConnectArgs.R @@ -13,7 +13,7 @@ #' instead of evaluating them. #' @param ... Other arguments passed on to methods. Not otherwise used. #' @family DBIConnector generics -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' cnr <- new("DBIConnector", #' .drv = RSQLite::SQLite(), #' .conn_args = list(dbname = ":memory:", password = function() "supersecret") diff --git a/R/dbGetQuery.R b/R/dbGetQuery.R index 4d4effc7b..1bdf8b45f 100644 --- a/R/dbGetQuery.R +++ b/R/dbGetQuery.R @@ -41,7 +41,7 @@ #' @family data retrieval generics #' @seealso For updates: [dbSendStatement()] and [dbExecute()]. #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "mtcars", mtcars) diff --git a/R/dbGetQueryArrow.R b/R/dbGetQueryArrow.R index 21a43b07d..3f1b1f3ea 100644 --- a/R/dbGetQueryArrow.R +++ b/R/dbGetQueryArrow.R @@ -1,5 +1,5 @@ #' @export -#' @examplesIf packageVersion("nanoarrow") >= "0.1.0.2" +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) && requireNamespace("nanoarrow", quietly = TRUE) && packageVersion("nanoarrow") >= "0.1.0.2" #' # Retrieve data as arrow table #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' diff --git a/R/dbGetRowCount.R b/R/dbGetRowCount.R index 8097c1c19..8adf6d32b 100644 --- a/R/dbGetRowCount.R +++ b/R/dbGetRowCount.R @@ -12,7 +12,7 @@ #' @inheritParams dbClearResult #' @family DBIResult generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "mtcars", mtcars) diff --git a/R/dbGetRowsAffected.R b/R/dbGetRowsAffected.R index 453cde259..4bd47c20b 100644 --- a/R/dbGetRowsAffected.R +++ b/R/dbGetRowsAffected.R @@ -15,7 +15,7 @@ #' @family DBIResult generics #' @family command execution generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "mtcars", mtcars) diff --git a/R/dbGetStatement.R b/R/dbGetStatement.R index 628507b36..94f963a35 100644 --- a/R/dbGetStatement.R +++ b/R/dbGetStatement.R @@ -12,7 +12,7 @@ #' @inheritParams dbClearResult #' @family DBIResult generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "mtcars", mtcars) diff --git a/R/dbHasCompleted.R b/R/dbHasCompleted.R index e178f468e..99e3e0c34 100644 --- a/R/dbHasCompleted.R +++ b/R/dbHasCompleted.R @@ -17,7 +17,7 @@ #' @family DBIResult generics #' @family data retrieval generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "mtcars", mtcars) diff --git a/R/dbIsValid.R b/R/dbIsValid.R index b686a6396..b46003c9a 100644 --- a/R/dbIsValid.R +++ b/R/dbIsValid.R @@ -13,7 +13,7 @@ #' @family DBIConnection generics #' @family DBIResult generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' dbIsValid(RSQLite::SQLite()) #' #' con <- dbConnect(RSQLite::SQLite(), ":memory:") diff --git a/R/dbListFields.R b/R/dbListFields.R index 29461ec43..5a1e3b55a 100644 --- a/R/dbListFields.R +++ b/R/dbListFields.R @@ -14,7 +14,7 @@ #' @family DBIConnection generics #' @seealso [dbColumnInfo()] to get the type of the fields. #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "mtcars", mtcars) diff --git a/R/dbListObjects.R b/R/dbListObjects.R index 5d07e0035..6c92f0a71 100644 --- a/R/dbListObjects.R +++ b/R/dbListObjects.R @@ -23,7 +23,7 @@ #' If given the method will return all objects accessible through this prefix. #' @family DBIConnection generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbListObjects(con) diff --git a/R/dbListTables.R b/R/dbListTables.R index 9a4f160c6..9a4581107 100644 --- a/R/dbListTables.R +++ b/R/dbListTables.R @@ -14,7 +14,7 @@ #' @inheritParams dbGetQuery #' @family DBIConnection generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbListTables(con) diff --git a/R/dbReadTable.R b/R/dbReadTable.R index eeec1bd75..b6cab3432 100644 --- a/R/dbReadTable.R +++ b/R/dbReadTable.R @@ -22,7 +22,7 @@ #' given verbatim, e.g. `SQL('"my_schema"."table_name"')` #' @family DBIConnection generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "mtcars", mtcars[1:10, ]) diff --git a/R/dbReadTableArrow.R b/R/dbReadTableArrow.R index 764ac0c94..9a36267d6 100644 --- a/R/dbReadTableArrow.R +++ b/R/dbReadTableArrow.R @@ -1,6 +1,6 @@ #' @rdname dbReadTable #' @export -#' @examplesIf packageVersion("nanoarrow") >= "0.1.0.2" +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) && requireNamespace("nanoarrow", quietly = TRUE) && packageVersion("nanoarrow") >= "0.1.0.2" #' # Read data as Arrow table #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' diff --git a/R/dbRemoveTable.R b/R/dbRemoveTable.R index de275f20e..fcda2905c 100644 --- a/R/dbRemoveTable.R +++ b/R/dbRemoveTable.R @@ -14,7 +14,7 @@ #' @inheritParams dbReadTable #' @family DBIConnection generics #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbExistsTable(con, "iris") diff --git a/R/dbSendQuery.R b/R/dbSendQuery.R index dac1260d5..d0c5d71af 100644 --- a/R/dbSendQuery.R +++ b/R/dbSendQuery.R @@ -36,7 +36,7 @@ #' @family DBIConnection generics #' @family data retrieval generics #' @seealso For updates: [dbSendStatement()] and [dbExecute()]. -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "mtcars", mtcars) diff --git a/R/dbSendQueryArrow.R b/R/dbSendQueryArrow.R index bcc2bc7c5..446dfa8bd 100644 --- a/R/dbSendQueryArrow.R +++ b/R/dbSendQueryArrow.R @@ -1,5 +1,5 @@ #' @rdname dbSendQuery -#' @examplesIf packageVersion("nanoarrow") >= "0.1.0.2" +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) && requireNamespace("nanoarrow", quietly = TRUE) && packageVersion("nanoarrow") >= "0.1.0.2" #' # Retrieve data as arrow table #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' diff --git a/R/dbSendStatement.R b/R/dbSendStatement.R index 55a35ead9..02e0d0bbd 100644 --- a/R/dbSendStatement.R +++ b/R/dbSendStatement.R @@ -30,7 +30,7 @@ #' @family command execution generics #' #' @seealso For queries: [dbSendQuery()] and [dbGetQuery()]. -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "cars", head(cars, 3)) diff --git a/R/dbWithTransaction.R b/R/dbWithTransaction.R index 244c75c18..9ce65b2cf 100644 --- a/R/dbWithTransaction.R +++ b/R/dbWithTransaction.R @@ -26,7 +26,7 @@ #' @param code An arbitrary block of R code. #' #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "cash", data.frame(amount = 100)) diff --git a/R/sqlData.R b/R/sqlData.R index 617628be8..e91f1a711 100644 --- a/R/sqlData.R +++ b/R/sqlData.R @@ -21,7 +21,7 @@ #' @templateVar method_name sqlData #' #' @export -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' sqlData(con, head(iris)) diff --git a/R/transactions.R b/R/transactions.R index 5a19045c8..a2d03d0b6 100644 --- a/R/transactions.R +++ b/R/transactions.R @@ -20,7 +20,7 @@ #' #' @inheritParams dbGetQuery #' @seealso Self-contained transactions: [dbWithTransaction()] -#' @examples +#' @examplesIf requireNamespace("RSQLite", quietly = TRUE) #' con <- dbConnect(RSQLite::SQLite(), ":memory:") #' #' dbWriteTable(con, "cash", data.frame(amount = 100)) diff --git a/man/DBI-package.Rd b/man/DBI-package.Rd index a5e7220a7..c7c3049c6 100644 --- a/man/DBI-package.Rd +++ b/man/DBI-package.Rd @@ -58,7 +58,9 @@ DBI recommends to define a constructor with an empty argument list. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} RSQLite::SQLite() +\dontshow{\}) # examplesIf} } \seealso{ Important generics: \code{\link[=dbConnect]{dbConnect()}}, \code{\link[=dbGetQuery]{dbGetQuery()}}, diff --git a/man/DBIConnection-class.Rd b/man/DBIConnection-class.Rd index 4121b460b..7b6ab1c00 100644 --- a/man/DBIConnection-class.Rd +++ b/man/DBIConnection-class.Rd @@ -16,6 +16,7 @@ connections. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") con dbDisconnect(con) @@ -24,6 +25,7 @@ con <- dbConnect(RPostgreSQL::PostgreSQL(), "username", "passsword") con dbDisconnect(con) } +\dontshow{\}) # examplesIf} } \seealso{ Other DBI classes: diff --git a/man/DBIConnector-class.Rd b/man/DBIConnector-class.Rd index 630d9fbc6..7778553b9 100644 --- a/man/DBIConnector-class.Rd +++ b/man/DBIConnector-class.Rd @@ -20,6 +20,7 @@ In such a case, the function is evaluated transparently when connecting in \code{\link[=dbGetConnectArgs]{dbGetConnectArgs()}}. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # Create a connector: cnr <- new("DBIConnector", .drv = RSQLite::SQLite(), @@ -34,6 +35,7 @@ con # Access the database through this connection: dbGetQuery(con, "SELECT 1 AS a") dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBI classes: diff --git a/man/DBIObject-class.Rd b/man/DBIObject-class.Rd index 514a046d4..a50a91357 100644 --- a/man/DBIObject-class.Rd +++ b/man/DBIObject-class.Rd @@ -36,6 +36,7 @@ tailor this appropriately. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} drv <- RSQLite::SQLite() con <- dbConnect(drv) @@ -46,6 +47,7 @@ is(rs, "DBIObject") dbClearResult(rs) dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBI classes: diff --git a/man/dbAppendTable.Rd b/man/dbAppendTable.Rd index 30ed2b5e2..b88d4584e 100644 --- a/man/dbAppendTable.Rd +++ b/man/dbAppendTable.Rd @@ -154,11 +154,13 @@ The order of the columns does not matter. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbCreateTable(con, "iris", iris) dbAppendTable(con, "iris", iris) dbReadTable(con, "iris") dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIConnection generics: diff --git a/man/dbBind.Rd b/man/dbBind.Rd index 23a678375..47c50674f 100644 --- a/man/dbBind.Rd +++ b/man/dbBind.Rd @@ -236,6 +236,7 @@ and with the value stored as integer) } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "iris", iris) @@ -257,6 +258,7 @@ dbClearResult(iris_result) nrow(dbReadTable(con, "iris")) dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIResult generics: diff --git a/man/dbCanConnect.Rd b/man/dbCanConnect.Rd index 01d092248..fbf3ee4a8 100644 --- a/man/dbCanConnect.Rd +++ b/man/dbCanConnect.Rd @@ -28,10 +28,12 @@ a lighter-weight check. \Sexpr[results=rd,stage=render]{DBI:::methods_as_rd("dbCanConnect")} } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # SQLite only needs a path to the database. (Here, ":memory:" is a special # path that creates an in-memory database.) Other database drivers # will require more details (like user, password, host, port, etc.) dbCanConnect(RSQLite::SQLite(), ":memory:") +\dontshow{\}) # examplesIf} } \seealso{ Other DBIDriver generics: diff --git a/man/dbClearResult.Rd b/man/dbClearResult.Rd index ce8fbb35d..75798fb7f 100644 --- a/man/dbClearResult.Rd +++ b/man/dbClearResult.Rd @@ -110,6 +110,7 @@ The DBI backend can expect a call to \code{dbClearResult()} for each } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") rs <- dbSendQuery(con, "SELECT 1") @@ -117,6 +118,7 @@ print(dbFetch(rs)) dbClearResult(rs) dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIResult generics: diff --git a/man/dbColumnInfo.Rd b/man/dbColumnInfo.Rd index 6dfc39c79..a991c897d 100644 --- a/man/dbColumnInfo.Rd +++ b/man/dbColumnInfo.Rd @@ -91,6 +91,7 @@ Column names that correspond to SQL or R keywords are left unchanged. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") rs <- dbSendQuery(con, "SELECT 1 AS a, 2 AS b") @@ -99,6 +100,7 @@ dbFetch(rs) dbClearResult(rs) dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIResult generics: diff --git a/man/dbConnect.Rd b/man/dbConnect.Rd index 0d2802204..86f7b07ad 100644 --- a/man/dbConnect.Rd +++ b/man/dbConnect.Rd @@ -65,6 +65,7 @@ and \code{\link[=as.character]{as.character()}} } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # SQLite only needs a path to the database. (Here, ":memory:" is a special # path that creates an in-memory database.) Other database drivers # will require more details (like user, password, host, port, etc.) @@ -79,6 +80,7 @@ dbDisconnect(con) # This code fails when RSQLite isn't loaded yet, # because dbConnect() doesn't know yet about RSQLite. dbListTables(con <- dbConnect(RSQLite::SQLite(), ":memory:")) +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[=dbDisconnect]{dbDisconnect()}} to disconnect from a database. diff --git a/man/dbCreateTable.Rd b/man/dbCreateTable.Rd index 09cc51bbf..3e5b7f12f 100644 --- a/man/dbCreateTable.Rd +++ b/man/dbCreateTable.Rd @@ -128,10 +128,12 @@ raise an error. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbCreateTable(con, "iris", iris) dbReadTable(con, "iris") dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIConnection generics: diff --git a/man/dbDataType.Rd b/man/dbDataType.Rd index e5121952c..2ea5b1dbf 100644 --- a/man/dbDataType.Rd +++ b/man/dbDataType.Rd @@ -101,6 +101,7 @@ dbDataType(ANSI(), list(raw(10), raw(20))) dbDataType(ANSI(), I(3)) dbDataType(ANSI(), iris) +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") @@ -117,6 +118,7 @@ dbDataType(con, I(3)) dbDataType(con, iris) dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIDriver generics: diff --git a/man/dbDisconnect.Rd b/man/dbDisconnect.Rd index 4cfaa10ef..8c6927dbc 100644 --- a/man/dbDisconnect.Rd +++ b/man/dbDisconnect.Rd @@ -34,8 +34,10 @@ or invalid connection. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIConnection generics: diff --git a/man/dbDriver.Rd b/man/dbDriver.Rd index 7061a986b..26c32a6b0 100644 --- a/man/dbDriver.Rd +++ b/man/dbDriver.Rd @@ -45,12 +45,14 @@ connecting to the database engine itself needs to be done through calls to \code{dbConnect}. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # Create a RSQLite driver with a string d <- dbDriver("SQLite") d # But better, access the object directly RSQLite::SQLite() +\dontshow{\}) # examplesIf} } \seealso{ Other DBIDriver generics: diff --git a/man/dbExecute.Rd b/man/dbExecute.Rd index 298b319fd..d1951940c 100644 --- a/man/dbExecute.Rd +++ b/man/dbExecute.Rd @@ -124,6 +124,7 @@ the backend tries \code{immediate = TRUE} (and gives a message) } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "cars", head(cars, 3)) @@ -143,6 +144,7 @@ dbExecute( dbReadTable(con, "cars") # there are now 10 rows dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ For queries: \code{\link[=dbSendQuery]{dbSendQuery()}} and \code{\link[=dbGetQuery]{dbGetQuery()}}. diff --git a/man/dbExistsTable.Rd b/man/dbExistsTable.Rd index 78689be58..7f94980b2 100644 --- a/man/dbExistsTable.Rd +++ b/man/dbExistsTable.Rd @@ -61,6 +61,7 @@ For all tables listed by \code{\link[=dbListTables]{dbListTables()}}, \code{dbEx } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbExistsTable(con, "iris") @@ -68,6 +69,7 @@ dbWriteTable(con, "iris", iris) dbExistsTable(con, "iris") dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIConnection generics: diff --git a/man/dbFetch.Rd b/man/dbFetch.Rd index 1b1dc278c..8b6f081c8 100644 --- a/man/dbFetch.Rd +++ b/man/dbFetch.Rd @@ -167,6 +167,7 @@ of the data } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars) @@ -185,6 +186,7 @@ while (!dbHasCompleted(rs)) { dbClearResult(rs) dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Close the result set with \code{\link[=dbClearResult]{dbClearResult()}} as soon as you diff --git a/man/dbGetConnectArgs.Rd b/man/dbGetConnectArgs.Rd index 8de3cb6d4..816a1b355 100644 --- a/man/dbGetConnectArgs.Rd +++ b/man/dbGetConnectArgs.Rd @@ -23,12 +23,14 @@ and usually does not need to be called directly. \Sexpr[results=rd,stage=render]{DBI:::methods_as_rd("dbGetConnectArgs")} } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} cnr <- new("DBIConnector", .drv = RSQLite::SQLite(), .conn_args = list(dbname = ":memory:", password = function() "supersecret") ) dbGetConnectArgs(cnr) dbGetConnectArgs(cnr, eval = FALSE) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIConnector generics: diff --git a/man/dbGetQuery.Rd b/man/dbGetQuery.Rd index b905c3901..2800b3d07 100644 --- a/man/dbGetQuery.Rd +++ b/man/dbGetQuery.Rd @@ -152,6 +152,7 @@ the backend tries \code{immediate = TRUE} (and gives a message) } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars) @@ -169,7 +170,8 @@ dbGetQuery( ) dbDisconnect(con) -\dontshow{if (packageVersion("nanoarrow") >= "0.1.0.2") (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{\}) # examplesIf} +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE) && requireNamespace("nanoarrow", quietly = TRUE) && packageVersion("nanoarrow") >= "0.1.0.2") (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # Retrieve data as arrow table con <- dbConnect(RSQLite::SQLite(), ":memory:") diff --git a/man/dbGetRowCount.Rd b/man/dbGetRowCount.Rd index d102b20e4..5d9783515 100644 --- a/man/dbGetRowCount.Rd +++ b/man/dbGetRowCount.Rd @@ -44,6 +44,7 @@ Attempting to get the row count for a result set cleared with } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars) @@ -58,6 +59,7 @@ nrow(ret1) + nrow(ret2) dbClearResult(rs) dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIResult generics: diff --git a/man/dbGetRowsAffected.Rd b/man/dbGetRowsAffected.Rd index e5d9d9dea..0244ff37a 100644 --- a/man/dbGetRowsAffected.Rd +++ b/man/dbGetRowsAffected.Rd @@ -64,6 +64,7 @@ Attempting to get the rows affected for a result set cleared with } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars) @@ -73,6 +74,7 @@ nrow(mtcars) dbClearResult(rs) dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIResult generics: diff --git a/man/dbGetStatement.Rd b/man/dbGetStatement.Rd index f13ff97be..9d59f0d1f 100644 --- a/man/dbGetStatement.Rd +++ b/man/dbGetStatement.Rd @@ -31,6 +31,7 @@ Attempting to query the statement for a result set cleared with } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars) @@ -39,6 +40,7 @@ dbGetStatement(rs) dbClearResult(rs) dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIResult generics: diff --git a/man/dbHasCompleted.Rd b/man/dbHasCompleted.Rd index 26bf2b87a..04d65a382 100644 --- a/man/dbHasCompleted.Rd +++ b/man/dbHasCompleted.Rd @@ -89,6 +89,7 @@ row. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars) @@ -102,6 +103,7 @@ dbHasCompleted(rs) dbClearResult(rs) dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIResult generics: diff --git a/man/dbIsValid.Rd b/man/dbIsValid.Rd index 1efd218a6..b014c3463 100644 --- a/man/dbIsValid.Rd +++ b/man/dbIsValid.Rd @@ -38,6 +38,7 @@ been disconnected or cleared). \Sexpr[results=rd,stage=render]{DBI:::methods_as_rd("dbIsValid")} } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} dbIsValid(RSQLite::SQLite()) con <- dbConnect(RSQLite::SQLite(), ":memory:") @@ -51,6 +52,7 @@ dbIsValid(rs) dbDisconnect(con) dbIsValid(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIDriver generics: diff --git a/man/dbListFields.Rd b/man/dbListFields.Rd index 74e716e9e..f78ed3768 100644 --- a/man/dbListFields.Rd +++ b/man/dbListFields.Rd @@ -65,12 +65,14 @@ A column named \code{row_names} is treated like any other column. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars) dbListFields(con, "mtcars") dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[=dbColumnInfo]{dbColumnInfo()}} to get the type of the fields. diff --git a/man/dbListObjects.Rd b/man/dbListObjects.Rd index b880e5c25..4454ce756 100644 --- a/man/dbListObjects.Rd +++ b/man/dbListObjects.Rd @@ -89,6 +89,7 @@ For the data frame returned from a \code{dbListObject()} call with the } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbListObjects(con) @@ -96,6 +97,7 @@ dbWriteTable(con, "mtcars", mtcars) dbListObjects(con) dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIConnection generics: diff --git a/man/dbListTables.Rd b/man/dbListTables.Rd index a8341989e..dc11cdfd1 100644 --- a/man/dbListTables.Rd +++ b/man/dbListTables.Rd @@ -44,6 +44,7 @@ or invalid connection. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbListTables(con) @@ -51,6 +52,7 @@ dbWriteTable(con, "mtcars", mtcars) dbListTables(con) dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIConnection generics: diff --git a/man/dbReadTable.Rd b/man/dbReadTable.Rd index 561b03212..25ad6ab74 100644 --- a/man/dbReadTable.Rd +++ b/man/dbReadTable.Rd @@ -117,13 +117,15 @@ perhaps by calling \code{dbQuoteIdentifier(conn, x = name)} } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars[1:10, ]) dbReadTable(con, "mtcars") dbDisconnect(con) -\dontshow{if (packageVersion("nanoarrow") >= "0.1.0.2") (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{\}) # examplesIf} +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE) && requireNamespace("nanoarrow", quietly = TRUE) && packageVersion("nanoarrow") >= "0.1.0.2") (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # Read data as Arrow table con <- dbConnect(RSQLite::SQLite(), ":memory:") diff --git a/man/dbRemoveTable.Rd b/man/dbRemoveTable.Rd index 68f678d1f..a78582f75 100644 --- a/man/dbRemoveTable.Rd +++ b/man/dbRemoveTable.Rd @@ -89,6 +89,7 @@ perhaps by calling \code{dbQuoteIdentifier(conn, x = name)} } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbExistsTable(con, "iris") @@ -98,6 +99,7 @@ dbRemoveTable(con, "iris") dbExistsTable(con, "iris") dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Other DBIConnection generics: diff --git a/man/dbSendQuery.Rd b/man/dbSendQuery.Rd index 07059430d..f47ed8573 100644 --- a/man/dbSendQuery.Rd +++ b/man/dbSendQuery.Rd @@ -178,6 +178,7 @@ the backend tries \code{immediate = TRUE} (and gives a message) } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars) @@ -203,7 +204,8 @@ dbFetch(rs) dbClearResult(rs) dbDisconnect(con) -\dontshow{if (packageVersion("nanoarrow") >= "0.1.0.2") (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\dontshow{\}) # examplesIf} +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE) && requireNamespace("nanoarrow", quietly = TRUE) && packageVersion("nanoarrow") >= "0.1.0.2") (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # Retrieve data as arrow table con <- dbConnect(RSQLite::SQLite(), ":memory:") diff --git a/man/dbSendStatement.Rd b/man/dbSendStatement.Rd index 04dc11df7..bc553b3d6 100644 --- a/man/dbSendStatement.Rd +++ b/man/dbSendStatement.Rd @@ -161,6 +161,7 @@ the backend tries \code{immediate = TRUE} (and gives a message) } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "cars", head(cars, 3)) @@ -193,6 +194,7 @@ dbClearResult(rs) dbReadTable(con, "cars") # there are now 10 rows dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ For queries: \code{\link[=dbSendQuery]{dbSendQuery()}} and \code{\link[=dbGetQuery]{dbGetQuery()}}. diff --git a/man/dbWithTransaction.Rd b/man/dbWithTransaction.Rd index 97668f95f..e249d7bd7 100644 --- a/man/dbWithTransaction.Rd +++ b/man/dbWithTransaction.Rd @@ -68,6 +68,7 @@ propagate to the calling environment. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "cash", data.frame(amount = 100)) @@ -108,4 +109,5 @@ dbReadTable(con, "cash") dbReadTable(con, "account") dbDisconnect(con) +\dontshow{\}) # examplesIf} } diff --git a/man/dbWriteTable.Rd b/man/dbWriteTable.Rd index b8a965b5d..c305d0c00 100644 --- a/man/dbWriteTable.Rd +++ b/man/dbWriteTable.Rd @@ -197,6 +197,7 @@ The default is \code{row.names = FALSE}. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars[1:5, ]) @@ -211,6 +212,7 @@ dbReadTable(con, "mtcars") # No row names dbWriteTable(con, "mtcars", mtcars[1:10, ], overwrite = TRUE, row.names = FALSE) dbReadTable(con, "mtcars") +\dontshow{\}) # examplesIf} } \seealso{ Other DBIConnection generics: diff --git a/man/sqlData.Rd b/man/sqlData.Rd index f008b828a..b8d29ca96 100644 --- a/man/sqlData.Rd +++ b/man/sqlData.Rd @@ -43,10 +43,12 @@ The default method: } } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") sqlData(con, head(iris)) sqlData(con, head(mtcars)) dbDisconnect(con) +\dontshow{\}) # examplesIf} } diff --git a/man/transactions.Rd b/man/transactions.Rd index cb8a09df2..8b03e83ac 100644 --- a/man/transactions.Rd +++ b/man/transactions.Rd @@ -91,6 +91,7 @@ The transaction isolation level is not specified by DBI. } \examples{ +\dontshow{if (requireNamespace("RSQLite", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "cash", data.frame(amount = 100)) @@ -121,6 +122,7 @@ dbReadTable(con, "cash") dbReadTable(con, "account") dbDisconnect(con) +\dontshow{\}) # examplesIf} } \seealso{ Self-contained transactions: \code{\link[=dbWithTransaction]{dbWithTransaction()}} diff --git a/vignettes/spec.Rmd b/vignettes/spec.Rmd index 427cbe190..373e08cb8 100644 --- a/vignettes/spec.Rmd +++ b/vignettes/spec.Rmd @@ -23,10 +23,17 @@ vignette: > %\VignetteEncoding{UTF-8} --- +```{r echo = FALSE} +knitr::opts_chunk$set( + echo = FALSE, + eval = requireNamespace("magrittr", quietly = TRUE) && requireNamespace("xml2", quietly = TRUE) +) +``` + + ```{r echo = FALSE} library(magrittr) library(xml2) -knitr::opts_chunk$set(echo = FALSE) r <- rprojroot::is_r_package$make_fix_file() ```