Skip to content

Commit 893871e

Browse files
committed
dont write files into anything but tempdir
1 parent 6e8a443 commit 893871e

16 files changed

+443
-1050
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Description: Easily automate the following tasks to describe data frames:
66
combine this information with metadata (such as item labels and labelled values) that is derived from R attributes.
77
To do so, the package relies on 'rmarkdown' partials, so you can generate HTML, PDF, and Word documents. Codebooks
88
are also available as tables (CSV, Excel, etc.).
9-
Version: 0.5.7
9+
Version: 0.5.8
1010
Authors@R: person("Ruben", "Arslan", email = "[email protected]", role = c("aut", "cre"))
1111
Depends: R (>= 3.0.1)
1212
URL: https://github.com/rubenarslan/codebook

R/codebook.R

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
#'
2222
#' @export
2323
#' @examples
24-
#' # will generate figures in a figure/ subdirectory
24+
#' # will generate figures in a temporary directory
25+
#' old_base_dir <- knitr::opts_knit$get("base.dir")
26+
#' knitr::opts_knit$set(base.dir = tempdir())
27+
#' on.exit(knitr::opts_knit$set(base.dir = old_base_dir))
2528
#' data("bfi")
2629
#' bfi <- bfi[, c("BFIK_open_1", "BFIK_open_1")]
2730
#' md <- codebook(bfi, survey_repetition = "single", metadata_table = FALSE)
@@ -273,7 +276,10 @@ codebook_items <- function(results, indent = "##") {
273276
#'
274277
#' @export
275278
#' @examples
276-
#' # will generate figure in a figure/ subdirectory
279+
#' # will generate figures in a temporary directory
280+
#' old_base_dir <- knitr::opts_knit$get("base.dir")
281+
#' knitr::opts_knit$set(base.dir = tempdir())
282+
#' on.exit(knitr::opts_knit$set(base.dir = old_base_dir))
277283
#' data("bfi")
278284
#' bfi <- bfi[,c("BFIK_open", paste0("BFIK_open_", 1:4))]
279285
#' codebook_component_scale(bfi[,1], "BFIK_open", bfi[,-1],
@@ -303,8 +309,11 @@ codebook_component_scale <- function(scale, scale_name, items, reliabilities,
303309
#'
304310
#' @export
305311
#' @examples
306-
#' # will generate figure in a figure/ subdirectory
307-
#' #' data("bfi")
312+
#' # will generate figure in a temporary directory
313+
#' old_base_dir <- knitr::opts_knit$get("base.dir")
314+
#' knitr::opts_knit$set(base.dir = tempdir())
315+
#' on.exit(knitr::opts_knit$set(base.dir = old_base_dir))
316+
#' data("bfi")
308317
#' codebook_component_single_item(bfi$BFIK_open_1, "BFIK_open_1")
309318
codebook_component_single_item <- function(item, item_name, indent = '##') {
310319
options <- list(
@@ -494,3 +503,5 @@ skim_to_wide_labelled <- function(...) {
494503
on.exit(skimr::skim_with_defaults())
495504
skimr::skim_to_wide(...)
496505
}
506+
507+

cran-comments.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
## Resubmission
2-
This is a second resubmission. In this version I have:
2+
This is the third resubmission. In this version I have:
3+
4+
* added the following code to examples that would have created figures in the user
5+
work space, so that figures are now written to a tempdir:
6+
#' old_base_dir <- knitr::opts_knit$get("base.dir")
7+
#' knitr::opts_knit$set(base.dir = tempdir())
8+
#' on.exit(knitr::opts_knit$set(base.dir = old_base_dir))
9+
10+
In the second resubmission I
311

412
* changed the title to omit "in R"
513
* changed the description to put 'rmarkdown' in single quotes

docs/articles/codebook.html

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
2.25 KB
Loading

docs/articles/index.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/codebook.html

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/codebook_component_scale.html

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/codebook_component_single_item.html

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/index.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)