Skip to content

Commit

Permalink
use assign
Browse files Browse the repository at this point in the history
  • Loading branch information
RossanaTat committed Apr 24, 2024
1 parent 467ed35 commit af2ae18
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ unmask_joyn_fun_old <- function(fun_name,
unmask_function_globenv <- function(fun_name,
pkg_name) {


stopifnot(exprs =
{pkg_name %in% tolower(.packages())})

Expand All @@ -367,13 +368,14 @@ unmask_function_globenv <- function(fun_name,
joyn_ns_exports_names <- getNamespaceExports(joyn_ns)

# get functions to unmask -filter those those that are in joyn_ns exports
funs_to_unmask <- fun_name[fun_name %in% joyn_ns_exports_names]
fun_name <- fun_name[fun_name %in% joyn_ns_exports_names]

new_mask <- getExportedValue(ns = getNamespace(pkg_name), name = fun_name)

fun_name <- new_mask
#left_join <- new_mask
assign(x = fun_name, value = new_mask)

# Inform the user
#Inform the user
clear_joynenv()

joyn:::store_msg(type = "info",
Expand All @@ -384,7 +386,7 @@ unmask_function_globenv <- function(fun_name,
bolded_pale = " {pkg_name}::{fun_name}",
pale = " preferred")

joyn:::joyn_msg()
joyn:::joyn_msg("info")

invisible(TRUE)
}
Expand Down

0 comments on commit af2ae18

Please sign in to comment.