ThinkR-open / attachment

Tools to deal with dependencies in scripts, Rmd and packages
https://thinkr-open.github.io/attachment/
Other
108 stars 13 forks source link

Search for packages listed as text for "Suggests" #30

Closed statnmap closed 2 years ago

statnmap commented 3 years ago

Apparently, now all packages that are listed in Suggests must be conditionally loaded. You have to test if they are installed, otherwise you should not run the vignette or the test.
I'll have to look for the packages in another way in {attachment}... :disappointed: Example here for a vignette : https://github.com/adamhsparks/epicrop/blob/d311ab5489e3f82fd6a67cdba8348af361c87fe5/vignettes/epirice.Rmd#L20 And here for a unit test: https://github.com/openplantpathology/hagis/commit/b9227fcee927f846cbd7fc9a9e7637a0cf23d795

Search for : skip_if_not_installed() or requireNamespace()

statnmap commented 2 years ago

requireNamespace() already included in att_from_rscript()
And concerning unit tests, developers would have to use library() or pkg::fun(), so this is also included.