lhenneman / hyspdisp

4 stars 4 forks source link

syntax package::function()? #33

Closed schoolAccountMajaG closed 4 years ago

schoolAccountMajaG commented 5 years ago

"Imports: packages listed here must be present for your package to work. In fact, any time your package is installed, those packages will, if not already present, be installed on your computer (devtools::load_all() also checks that the packages are installed).

Adding a package dependency here ensures that it’ll be installed. However, it does not mean that it will be attached along with your package (i.e., library(x)). The best practice is to explicitly refer to external functions using the syntax package::function(). This makes it very easy to identify which functions live outside of your package. This is especially useful when you read your code in the future."

http://r-pkgs.had.co.nz/description.html

Should we implement package::function()?

For example, we could do it here: https://github.com/lhenneman/hyspdisp/blob/master/R/hyspdisp_fac_model.R#L113 as create_disp_model comes from SplitR.

What do you think @cchoirat?

cchoirat commented 5 years ago

yes, that's good practice

On Fri, Jun 14, 2019 at 9:50 AM Maja notifications@github.com wrote:

"Imports: packages listed here must be present for your package to work. In fact, any time your package is installed, those packages will, if not already present, be installed on your computer (devtools::load_all() also checks that the packages are installed).

Adding a package dependency here ensures that it’ll be installed. However, it does not mean that it will be attached along with your package (i.e., library(x)). The best practice is to explicitly refer to external functions using the syntax package::function(). This makes it very easy to identify which functions live outside of your package. This is especially useful when you read your code in the future."

http://r-pkgs.had.co.nz/description.html

Should we implement package::function()?

For example, we could do it here: https://github.com/lhenneman/hyspdisp/blob/master/R/hyspdisp_fac_model.R#L113 as create_disp_model comes from SplitR.

What do you think @cchoirat https://github.com/cchoirat?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lhenneman/hyspdisp/issues/33?email_source=notifications&email_token=AA73AZOWLKN23S6XYSQV2PLP2NEVLA5CNFSM4HYFMEZ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GZPVV4Q, or mute the thread https://github.com/notifications/unsubscribe-auth/AA73AZNSTJELK2SB5MLQX4DP2NEVLANCNFSM4HYFMEZQ .

schoolAccountMajaG commented 4 years ago

implemented