Skip to content

Commit b1e0e3f

Browse files
committed
Uploading examples to include dontrun instead to avoid touching api at all
1 parent e412dfa commit b1e0e3f

50 files changed

Lines changed: 111 additions & 235 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DESCRIPTION

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: neotoma2
22
Title: Working with the Neotoma Paleoecology Database
3-
Date: 2025-12-12
3+
Date: 2025-12-13
44
Version: 1.0.11
55
Authors@R:
66
c(person(given = "Dominguez Vidana",
@@ -17,6 +17,8 @@ URL: https://github.com/NeotomaDB/neotoma2
1717
BugReports: https://github.com/NeotomaDB/neotoma2/issues
1818
Description: Access and manipulation of data using the Neotoma Paleoecology Database.
1919
<https://api.neotomadb.org/api-docs/>.
20+
Examples in functions that require API access are not executed during CRAN checks.
21+
Vignettes do not execute as to avoid API calls during CRAN checks.
2022
License: MIT + file LICENSE
2123
Encoding: UTF-8
2224
Roxygen: list(markdown = TRUE)

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## neotoma2 1.0.11
44

5-
Added flag error=True to all vignette codechunks to not run when API is down in case API comes down in between a knitting.
5+
Set examples to \dontrun{} to avoid violating CRAN's policy that allows access to internet.
6+
Set vignettes to `eval=FALSE` as to avoid calling APIs that require access to internet.
7+
Set all tests that require API call to `skip on CRAN`.
68

79
## neotoma2 1.0.10
810

R/01_classDefinitions.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ setClassUnion("id", c("character", "integer", "numeric"))
77
#' @name contacts_classes
88
#' @description An unordered list of individual S4 `contact` objects.
99
#' @export
10-
#' @examples
10+
#' @examples {
1111
#' new("contact", familyname = "Goring", givennames = "Simon J.")
12+
#' }
1213
#' @returns object of class `contact`
1314
#' @aliases contact-class
1415
#' @md

R/clean.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#' * After: \{site: 1, dataset: \[1, 2\]\}
1717
#' So the site is gathered, and the datasets are now part of an
1818
#' array of datasets.
19-
#' @examples \donttest{
19+
#' @examples \dontrun{
2020
#' tryCatch({
2121
#' alex <- get_sites(sitename = "Alex%")
2222
#' alex2 <- get_sites(24)

R/filter.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#' @param .by (only used for filtering `data.frame` objects)
5050
#' @param .preserve (only used for filtering `data.frame` objects)
5151
#' @returns filtered `sites` object
52-
#' @examples \donttest{
52+
#' @examples \dontrun{
5353
#' # Download 10 sites, but only keep the sites that are close to sea level.
5454
#' tryCatch({
5555
#' some_sites <- get_sites(sitename = "Lake%", limit = 3)

R/get_datasets.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
#' record.
6161
#' * `all_data` The API only downloads the first 25 records of the query.
6262
#' For the complete records, use `all_data=TRUE`
63-
#' @examples \donttest{
63+
#' @examples \dontrun{
6464
#' tryCatch({
6565
#' random_sites <- get_sites(1)
6666
#' allds <- get_datasets(random_sites, limit=3)

R/get_documentation.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#' @importFrom utils browseURL
55
#' @importFrom rlang is_interactive
66
#' @returns NULL
7-
#' @examples \donttest{
7+
#' @examples \dontrun{
88
#' if (interactive()) {
99
#' get_documentation()
1010
#' }

R/get_downloads.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#' \item{ \code{pi list} }{P.I. info}
4949
#' \item{ \code{analyst} }{analyst info}
5050
#' \item{ \code{metadata} }{dataset metadata}
51-
#' @examples \donttest{
51+
#' @examples \dontrun{
5252
#' # To find the downloads object of dataset 24:
5353
#' tryCatch({
5454
#' downloads24 <- get_downloads(24)

R/get_manual.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#' @description Open up the Neotoma manual homepage.
44
#' @importFrom utils browseURL
55
#' @importFrom rlang is_interactive
6-
#' @examples {
6+
#' @examples \dontrun{
77
#' # This call does not work from `source()` calls or in testing.
88
#' # interactive() just lets us know you are interacting with the console:
99
#' if (interactive()) {

R/get_publications.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#' `year` The year the publication was released.
1818
#' `search` A plain text search string used to search the citation.
1919
#' @returns `publications` object
20-
#' @examples \donttest{
20+
#' @examples \dontrun{
2121
#' # How old are the papers in Neotoma that include the term "mammut"?
2222
#' tryCatch({
2323
#' mammoth_papers <- get_publications(search="mammut") %>%

0 commit comments

Comments
 (0)