How to define “hidden global variables” inside R packages?

前端 未结 2 1768
深忆病人
深忆病人 2021-01-11 12:52

I have the following 2 functions in R:

exs.time.start<-function(){
  exs.time<<-proc.time()[3]
  return(invisible(NULL))
}

exs.time.stop<-functi         


        
2条回答
  •  遥遥无期
    2021-01-11 13:06

    I use package-global environments in a few packages:

    • RcppGSL stores config info about the GSL libraries

    • RPushbullet stores some user-related meta data

    and there are probably some more but you get the idea.

提交回复
热议问题