Skip to content

Commit

Permalink
Corrected dontrun to donttest for examples, based on feedback from CR…
Browse files Browse the repository at this point in the history
…AN team
  • Loading branch information
dmi3kno committed Nov 22, 2019
1 parent cc0aa12 commit 67c1c3d
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 15 deletions.
4 changes: 2 additions & 2 deletions R/bow.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @return object of class `polite`, `session`
#'
#' @examples
#' \dontrun{
#' \donttest{
#' library(polite)
#'
#' host <- "https://www.cheese.com"
Expand Down Expand Up @@ -95,7 +95,7 @@ bow <- function(url,
#' @return Updates rate-limit property of `scrape` and `rip` functions, respectively.
#'
#' @examples
#' \dontrun{
#' \donttest{
#' library(polite)
#'
#' host <- "https://www.cheese.com"
Expand Down
2 changes: 2 additions & 0 deletions R/html.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
#' @export
#'
#' @examples
#' \donttest{
#' library(polite)
#' library(rvest)
#' bow("https://en.wikipedia.org/wiki/List_of_cognitive_biases") %>%
#' scrape() %>%
#' html_nodes("tr td:nth-child(1) a") %>%
#' html_attrs_dfr()
#' }
#' @importFrom rvest html_text html_attrs html_attr
#' @importFrom stats setNames
html_attrs_dfr <- function(x, attrs=NULL, trim=FALSE, defaults=NA_character_, add_text=TRUE){
Expand Down
2 changes: 1 addition & 1 deletion R/nod.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @return object of class `polite`, `session` with modified URL
#'
#' @examples
#' \dontrun{
#' \donttest{
#' library(polite)
#'
#' host <- "https://www.cheese.com"
Expand Down
8 changes: 4 additions & 4 deletions R/rip.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#' @export
#'
#' @examples
#' \dontrun{
#' bow("www.mysite.com") %>%
#' nod("file.txt") %>%
#' rip()
#' \donttest{
#' bow("https://www.cheese.com/") %>%
#' nod("media/img/sub-page-slide2.jpg") %>%
#' rip()
#' }
#' @importFrom here here
#' @importFrom tools file_path_sans_ext file_ext
Expand Down
2 changes: 1 addition & 1 deletion R/scrape.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ m_scrape <- function(bow, query=NULL, params=NULL, accept="html", content=NULL,
#' @return Object of class `httr::response` which can be further processed by functions in `rvest` package
#'
#' @examples
#' \dontrun{
#' \donttest{
#' library(rvest)
#' biases <- bow("https://en.wikipedia.org/wiki/List_of_cognitive_biases") %>%
#' scrape(content="text/html; charset=UTF-8") %>%
Expand Down
16 changes: 16 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Resubmission 2
CRAN team -
This is a second resubmission of a new package responding to feedback from Martina Schmirl on Resubmission 1 below.

#> \dontrun{} should be only used if the example really cannot be executed
#> (e.g. because of missing additional software, missing API keys, ...) by
#> the user. That's why wrapping examples in \dontrun{} adds the comment
#> ("# Not run:") as a warning for the user.
#> Does not seem necessary, please replace with \donttest or explain.

Agreed. Provided more realistic examples and replaced \dontrun{} with \donttest{}

Thank you for reviewing my submission!
Regards,
Dmytro

# Resubmission 1

CRAN team -
Expand Down
2 changes: 1 addition & 1 deletion man/bow.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/html_attrs_dfr.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/nod.Rd

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

8 changes: 4 additions & 4 deletions man/rip.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/set_delay.Rd

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

0 comments on commit 67c1c3d

Please sign in to comment.