Closed z267xu closed 1 year ago
Hi! The documentation in the last commit da665aea43f2e321e5a31313d87b6d31abe58619 could be useful for your problem. Let me know if the problem still persists.
Hi Sherry
Thanks! It works.
However, I think this could not be a good idea to ask users to define a variable ahead in the environment... I would suggest the code look into it, if record
is not found, then create one and leave a message, for example
tryCatch(expr = {
rcd_env <- parent.frame(n = 3)
rcd_env[["record"]] <- dplyr::add_row(rcd_env[["record"]],
basis = list(current), index_val = cur_index, info = "new_basis",
method = method, alpha = formals(guided_tour)$alpha, tries = 1,
loop = 1)
}, error = function(e) {
# record is not defined in `parent.frame()`
# leave a message or something else
assign("record", record <- dplyr::tibble(basis = list(),index_val = numeric(), info = character(), method = character(), alpha =
numeric(), tries = numeric(), loop = numeric()), env ...)
rcd_env[["record"]] <- dplyr::tibble(basis = list(current), index_val = cur_index, info = "new_basis",
method = method, alpha = formals(guided_tour)$alpha,
tries = 1, loop = 1)
})
It is just an idea came to my mind. There should be some more elegant way to make it work
Dear maintainer I recently built a package based on
tourr
. After I updatetourr
to 0.6.0, theguided_tour
does not work anymore. I checked my code, I think the reason comes from here:The reason may come from this line
If I call
tour_path(NULL, iris[, -5])
in the global environment,rcd_env
seems fail to locate the env.