diff --git a/DESCRIPTION b/DESCRIPTION index 98bce16..911c8e6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: ngramr Type: Package Title: Retrieve and Plot Google n-Gram Data -Version: 1.8.1 +Version: 1.8.2 Date: 2022-09-10 Authors@R: c( person("Sean", "Carmody", email = "seancarmody@gmail.com", role = c("aut", "cre", "cph")) diff --git a/NEWS.md b/NEWS.md index 3ff2056..3329bd3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# ngramr 1.8.2 + +* Suppress testing of all examples that make internet calls + # ngramr 1.8.1 * Handle offline state diff --git a/R/ggram.R b/R/ggram.R index b48edd1..80b5ba7 100644 --- a/R/ggram.R +++ b/R/ggram.R @@ -21,8 +21,8 @@ #' Google will update these datasets as book scanning continues. #' #' @examples -#' library(ggplot2) -#'\donttest{ggram(c("hacker", "programmer"), year_start = 1950) +#' \donttest{library(ggplot2) +#' ggram(c("hacker", "programmer"), year_start = 1950) #' #' # Changing the geom. #' ggram(c("cancer", "fumer", "cigarette"), @@ -54,9 +54,10 @@ #' "((The United States are + The United States have) / The United States)") #' ggram(p, year_start = 1800, google_theme = TRUE) + #' theme(legend.direction="vertical") -#'} +#' #' # Pass ngram data rather than phrases #' ggram(hacker) + facet_wrap(~ Corpus) +#'} #' @export ggram <- function(phrases, ignore_case = FALSE, code_corpus = FALSE, diff --git a/R/methods.R b/R/methods.R index c948448..29864a1 100644 --- a/R/methods.R +++ b/R/methods.R @@ -6,8 +6,9 @@ #' @export #' @method print ngram #' @examples -#' x <- ngram(c("hacker", "programmer"), year_start = 1950) +#' \donttest{x <- ngram(c("hacker", "programmer"), year_start = 1950) #' print(x) +#' } print.ngram <- function(x, rows=6, ...) { df <- x diff --git a/man/ggram.Rd b/man/ggram.Rd index c37fc86..732a946 100644 --- a/man/ggram.Rd +++ b/man/ggram.Rd @@ -46,8 +46,8 @@ books collection. One was generated in July 2009, the second in July 2012. Google will update these datasets as book scanning continues. } \examples{ -library(ggplot2) -\donttest{ggram(c("hacker", "programmer"), year_start = 1950) +\donttest{library(ggplot2) +ggram(c("hacker", "programmer"), year_start = 1950) # Changing the geom. ggram(c("cancer", "fumer", "cigarette"), @@ -79,7 +79,8 @@ p <- c("((The United States is + The United States has) / The United States)", "((The United States are + The United States have) / The United States)") ggram(p, year_start = 1800, google_theme = TRUE) + theme(legend.direction="vertical") -} + # Pass ngram data rather than phrases ggram(hacker) + facet_wrap(~ Corpus) } +} diff --git a/man/print.ngram.Rd b/man/print.ngram.Rd index a11f914..8475abc 100644 --- a/man/print.ngram.Rd +++ b/man/print.ngram.Rd @@ -17,6 +17,7 @@ Print n-gram contents } \examples{ -x <- ngram(c("hacker", "programmer"), year_start = 1950) +\donttest{x <- ngram(c("hacker", "programmer"), year_start = 1950) print(x) } +}