Skip to content

Commit

Permalink
Address feedback from CRAN, second attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
thebioengineer committed Oct 2, 2022
1 parent e22ad29 commit 889582e
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 12 deletions.
4 changes: 2 additions & 2 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.1.0
Date: 2022-09-29 00:45:15 UTC
SHA: bcd9873592c0964484d0fe553bf76c69fe8aa883
Date: 2022-09-29 16:16:36 UTC
SHA: e22ad295f8a6e8bf5db582a449e55005a6a2a78a
6 changes: 5 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ Authors@R:
role = c("ctb")
)
)
Description: Record and generate a gif of your R sessions plots.
Description: Record and generate a 'gif' of your 'R' sessions plots. When creating
a visualization, there is inevitably iteration and refinement that occurs.
Automatically save the plots made to a specified directory, previewing them
as they would be saved. Then combine all plots generated into a 'gif'
to show the plot refinement over time.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Expand Down
11 changes: 5 additions & 6 deletions R/gg_record.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#' @title Record and generate plot histories
#'
#' @description Record plots created over time and generate a gif of the plots
#' made in the R session.
#' @description Record plots created over time and generate a GIF of the plots
#' made in the 'R' session. Overrides the print methods for ggplot and patchwork objects
#' from the 'ggplot2' and 'patchwork' packages respectively.
#'
#' @rdname Recording
#'
#' @param dir directory to save the intermediate plots in
#' @param dir directory to save the intermediate plots in. Defaults to a temporary directory
#' @param device Device to use. Can either be a device function (e.g. png()), or
#' one of "png", "pdf", "jpeg", "bmp", "tiff", "emf", "svg", "eps", "ps".
#' @param device_ext file extension to use for images created. Does not usually need to be populated manually.
Expand Down Expand Up @@ -165,9 +166,7 @@ gg_playback <-

if (is.null(name)) {
recording <- paste0(format(Sys.time(), "%Y_%m_%d_%H_%M_%S"), ".gif")
if (!GG_RECORDING_ENV$is_temp_dir) {
recording <- file.path(GG_RECORDING_ENV$recording_dir, recording)
}
recording <- file.path(GG_RECORDING_ENV$recording_dir, recording)
} else{
recording <- name
}
Expand Down
3 changes: 3 additions & 0 deletions R/recording.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ record_patchwork <- function(x,...) {
#' function to capture what has been printed to the current graphics device and
#' save it using the current camcorder settings
#'
#' @returns No return value. Used for the side effect of capturing the current
#' graphics device and saving it to the set directory from gg_record.
#'
#' @examples
#'
#' library(grid)
Expand Down
2 changes: 2 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ There are currently no downstream dependencies on this package as it is the firs
## Notes

Resubmission removing large gif files to make submission <5mb
Updates to documentation including adding the "value" param for record_polaroid,
and wrapping packages and API's in single quotes.
7 changes: 4 additions & 3 deletions man/Recording.Rd

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

4 changes: 4 additions & 0 deletions man/record_polaroid.Rd

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

2 changes: 2 additions & 0 deletions tests/testthat/test-recording.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ test_that("recording works - gif output", {

test_that("resizing a plot works", {

skip_on_cran()

rec_dir <- file.path(tempdir(),"camcorder_tests_resizing")

if(dir.exists(rec_dir)){
Expand Down

0 comments on commit 889582e

Please sign in to comment.