rprofile - Mask a function from `ls` in R -
i want put following function in .rprofile make installation of bioconductor packages easier:
install.bioconductor <- function(...) { source("http://bioconductor.org/bioclite.r") bioclite(...) }
but when load new r session, function listed when call ls
. there way of masking function being shown?
you can put in own environment , attach environment search path.
myfuns <- new.env() myfuns$install.bioconductor <- function(...) { source("http://bioconductor.org/bioclite.r") bioclite(...) } attach(myfuns) # attach search path rm(myfuns) # remove .globalenv # still accessible via # install.bioconductor(...)
then accessible, not show in ls()
. (you can see attached search path search()
, , can see in myfuns
ls(myfuns)
)
alternatively, @joshuao'brien mentioned in comment can keep in .globalenv
add dot beginning of name (i.e. name .install.bioconductor
) "hidden" such won't show ls()
, show ls(all.names=true)
.
Comments
Post a Comment