Skip to content

Commit

Permalink
Extra pause and dir_name check
Browse files Browse the repository at this point in the history
  • Loading branch information
YuhangTom committed Mar 19, 2024
1 parent 312fb2f commit 4e7e7fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ importFrom(stats,quantile)
importFrom(stats,sd)
importFrom(stats,t.test)
importFrom(stringr,str_detect)
importFrom(stringr,str_remove)
importFrom(tidyr,nest)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,unnest)
Expand Down
4 changes: 3 additions & 1 deletion R/x3p_impute.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#' @importFrom magick image_read image_join image_animate image_write
#' @importFrom stringr str_detect
#' @importFrom assertthat assert_that is.flag not_empty is.string
#' @importFrom stringr str_remove
#' @export
#' @examples
#' x3p <- x3p_subsamples[[1]]
Expand Down Expand Up @@ -57,6 +58,7 @@ x3p_impute <- function(x3p, ifout = FALSE, ifsave = FALSE, dir_name = NULL, gif_
assert_that(
is.string(dir_name)
)
dir_name <- str_remove(dir_name, "/$")
} else {
# dir_name <- tempdir(check = TRUE)
tmpfile <- tempfile(fileext = "txt")
Expand Down Expand Up @@ -250,7 +252,7 @@ x3p_impute <- function(x3p, ifout = FALSE, ifsave = FALSE, dir_name = NULL, gif_

if (ifsave) {
### List file names and read in
x3p_inner_nomiss_res_focal_impute_gif <- paste0(dir_name, "/gif_p", 0:nimp, ".png") %>%
x3p_inner_nomiss_res_focal_impute_gif <- paste0(dir_name, "/gif_p", c(rep(0, 4), 0:nimp, rep(nimp, 9)), ".png") %>%
map(image_read) %>%
### Join the images together
image_join() %>%
Expand Down

0 comments on commit 4e7e7fb

Please sign in to comment.