You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current diagnotics use lintr which is mainly focused on style diagnostics. However, code correctness is largely not diagnosed. An obvious one is to check if there is any library(pkg) call that points to non-installed package. Similar calls include require(pkg), loadNamespace("pkg"), requireNamespace("pkg"), pkg::foo, pkg:::bar.
The recently released lintr v2.0.0 supports customized lintr. I'm not sure if it is better to use this or separate correctness checks from linting.
I am not sure, users can always define their own linters and specify those in their .lintr configuration.
Of course, if you are ambitious enough, it is would be useful to the general R community if you put the extra linters together and create a separate R package, say morelintr.
Then in the README, we could point the interested readers to the package.
This is only a mimic behavior of RStudio which detects required not installed packages in a script and notify the user if they want to install them. I think this feature makes sense and makes it convenient to work with scripts given by other users though I personally don't use it much.
r-lib/lintr#547 provides a missing_package_linter so that upgrading to the latest development version of lintr and adding this linter to the .lintr config file will resolve this issue.
Activity
randy3k commentedon Oct 2, 2019
I am not sure, users can always define their own linters and specify those in their
.lintrconfiguration.Of course, if you are ambitious enough, it is would be useful to the general R community if you put the extra linters together and create a separate R package, say
morelintr.Then in the README, we could point the interested readers to the package.
renkun-ken commentedon Oct 3, 2019
This is only a mimic behavior of RStudio which detects required not installed packages in a script and notify the user if they want to install them. I think this feature makes sense and makes it convenient to work with scripts given by other users though I personally don't use it much.
renkun-ken commentedon Apr 29, 2021
r-lib/lintr#547 provides a
missing_package_linterso that upgrading to the latest development version of lintr and adding this linter to the.lintrconfig file will resolve this issue.