Skip to content

Commit

Permalink
dont write files into anything but tempdir
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenarslan committed Mar 21, 2018
1 parent 6e8a443 commit 893871e
Show file tree
Hide file tree
Showing 16 changed files with 443 additions and 1,050 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Description: Easily automate the following tasks to describe data frames:
combine this information with metadata (such as item labels and labelled values) that is derived from R attributes.
To do so, the package relies on 'rmarkdown' partials, so you can generate HTML, PDF, and Word documents. Codebooks
are also available as tables (CSV, Excel, etc.).
Version: 0.5.7
Version: 0.5.8
Authors@R: person("Ruben", "Arslan", email = "[email protected]", role = c("aut", "cre"))
Depends: R (>= 3.0.1)
URL: https://github.com/rubenarslan/codebook
Expand Down
19 changes: 15 additions & 4 deletions R/codebook.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
#'
#' @export
#' @examples
#' # will generate figures in a figure/ subdirectory
#' # will generate figures in a temporary directory
#' old_base_dir <- knitr::opts_knit$get("base.dir")
#' knitr::opts_knit$set(base.dir = tempdir())
#' on.exit(knitr::opts_knit$set(base.dir = old_base_dir))
#' data("bfi")
#' bfi <- bfi[, c("BFIK_open_1", "BFIK_open_1")]
#' md <- codebook(bfi, survey_repetition = "single", metadata_table = FALSE)
Expand Down Expand Up @@ -273,7 +276,10 @@ codebook_items <- function(results, indent = "##") {
#'
#' @export
#' @examples
#' # will generate figure in a figure/ subdirectory
#' # will generate figures in a temporary directory
#' old_base_dir <- knitr::opts_knit$get("base.dir")
#' knitr::opts_knit$set(base.dir = tempdir())
#' on.exit(knitr::opts_knit$set(base.dir = old_base_dir))
#' data("bfi")
#' bfi <- bfi[,c("BFIK_open", paste0("BFIK_open_", 1:4))]
#' codebook_component_scale(bfi[,1], "BFIK_open", bfi[,-1],
Expand Down Expand Up @@ -303,8 +309,11 @@ codebook_component_scale <- function(scale, scale_name, items, reliabilities,
#'
#' @export
#' @examples
#' # will generate figure in a figure/ subdirectory
#' #' data("bfi")
#' # will generate figure in a temporary directory
#' old_base_dir <- knitr::opts_knit$get("base.dir")
#' knitr::opts_knit$set(base.dir = tempdir())
#' on.exit(knitr::opts_knit$set(base.dir = old_base_dir))
#' data("bfi")
#' codebook_component_single_item(bfi$BFIK_open_1, "BFIK_open_1")
codebook_component_single_item <- function(item, item_name, indent = '##') {
options <- list(
Expand Down Expand Up @@ -494,3 +503,5 @@ skim_to_wide_labelled <- function(...) {
on.exit(skimr::skim_with_defaults())
skimr::skim_to_wide(...)
}


10 changes: 9 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Resubmission
This is a second resubmission. In this version I have:
This is the third resubmission. In this version I have:

* added the following code to examples that would have created figures in the user
work space, so that figures are now written to a tempdir:
#' old_base_dir <- knitr::opts_knit$get("base.dir")
#' knitr::opts_knit$set(base.dir = tempdir())
#' on.exit(knitr::opts_knit$set(base.dir = old_base_dir))

In the second resubmission I

* changed the title to omit "in R"
* changed the description to put 'rmarkdown' in single quotes
Expand Down
34 changes: 17 additions & 17 deletions docs/articles/codebook.html

Large diffs are not rendered by default.

Binary file modified docs/articles/codebook_files/figure-html/age_distribution-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/articles/index.html

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

5 changes: 4 additions & 1 deletion docs/reference/codebook.html

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

5 changes: 4 additions & 1 deletion docs/reference/codebook_component_scale.html

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

7 changes: 5 additions & 2 deletions docs/reference/codebook_component_single_item.html

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

2 changes: 1 addition & 1 deletion docs/reference/index.html

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

9 changes: 8 additions & 1 deletion docs/reference/knit_print.alpha.html

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

Loading

0 comments on commit 893871e

Please sign in to comment.