Skip to content

Commit

Permalink
fix retrieval of simulated values
Browse files Browse the repository at this point in the history
  • Loading branch information
emitanaka committed Oct 14, 2023
1 parent 213b5a8 commit e397e1b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions R/provenance.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ Provenance <- R6::R6Class("Provenance",
#private$record_track_internal()
for(obj in overwrite) {
if(obj=="simulate_result") {
private$simulate_result_env <- new_environment()
list2env(design[[obj]], envir = private$simulate_result_env)
e <- private$simulate_result_env
rm(list = ls(envir = e, all.names = TRUE), envir = e)
list2env(design[[obj]], envir = e)
} else {
private[[obj]] <- design[[obj]]
}
Expand Down
2 changes: 1 addition & 1 deletion R/simulate.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ simulate_rcrds <- function(.data, ..., .seed = NULL) {
.data, unname(y), dots[[aprocess]]$censor)
}
}
.data
return_edibble_with_graph(.data, prov)
}

get_rcrd_values <- function(rname, prov, aggfn, .data, y, censor) {
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ return_edibble_with_graph <- function(edibble, prov) {
des$graph <- prov$get_graph()
des$validation <- prov$get_validation()
des$simulate <- prov$get_simulate()
sim_res <- ls(envir = prov$get_simulate_result_env())
sim_res <- ls(envir = prov$get_simulate_result_env(), all.names = TRUE)
if(length(sim_res)) {
des$simulate_result <- mget(sim_res, prov$get_simulate_result_env())
}
Expand Down

0 comments on commit e397e1b

Please sign in to comment.