Is it possible to hide functions from being shown in excel but that exist in the functions.R file? At the moment all functions are exposed to excel as R functions but I would like to be able to select which functions are exposed.
BERT exposes all functions from the global environment. If you want to have functions in the console but not in Excel, put them in a separate environment (you can attach
it so they're in the global namespace).
For example, in the functions file
visible.func <- function(){ 100 }
console.env <- new.env();
with( console.env, {
hidden.func <- function(){ 200 }
});
attach(console.env);
then visible.func
will be visible in both R and Excel, while hidden.func
will only be visible in the console.
Just be aware of the consequences of things being in different environments.
Why do it this way, and not the reverse (have a special environment for Excel functions)? Because the primary use-case is for Excel functions, so that one is the default.