I want to put the following function in my .Rprofile to make installation of bioconductor packages easier:
install.bioconductor <- function(...) {
source("http://bioconductor.org/biocLite.R")
biocLite(...)
}
But when I load a new R session, this function is now listed when I call ls
. Is there a way of masking the function from being shown?
You can put it in its own environment and attach that environment to the search path.
Then it be accessible, but will not show up in
ls()
. (You can see what is attached to the search path withsearch()
, and you can see what is inmyFUNs
withls(myFUNs)
)Alternatively, as @JoshuaO'Brien mentioned in a comment you can keep it in the
.GlobalEnv
but add a dot to the beginning of the name (i.e. name it.install.bioconductor
) so that it will be "hidden" such that it won't show up withls()
, but will show up withls(all.names=TRUE)
.