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

Do not use stringified references to packages #11

Closed dmenne closed 5 years ago

dmenne commented 5 years ago

I have the string `gastempt::powexp_slope() in a test-comment, leading to this package being included in suggests. Strings should not be searched for dependencies.

cap = paste0("Meal volume (left) and flow when gastric emptying function is a power exponential function. Slope was computed with  function `gastempt::powexp_slope()`"
statnmap commented 5 years ago

Hi, In cases where we use some of our packages, we need to parse strings too.
But, if you do not want this package to be listed, you can use parameter attachment::att_to_description(pkg_ignore = "gastempt")

Or do you mean that code starting as comment with # should not be included ?

dmenne commented 5 years ago

Yes, I noted that I could have excluded it, but I just run the program and sent it to travis-ci where it failed. I myself was surprised to find the reference to a github-only package in my tests, but it made sense.

This is not code in #, but some text in a vignette:

https://github.com/dmenne/breathtestcore/blob/master/vignettes/methods_and_concepts.Rmd

If it is too much work, leave it as is. One normally will run the program only once in a while.

statnmap commented 5 years ago

Normally, text in vignettes is not read. I use knitr::purl() before checking for packages calls to only extract code chunks.

statnmap commented 5 years ago

Ah yes, I see in your code. This is your caption that is created in a chunk.
Either you use the ascii stringi::stri_trans_general(":", "hex") or you had it in pkg_ignore.

In my opinion, we can not automatically know if this kind of text is to be included as suggests or not. It depends on the context I think.
Hence, I do not plan to manage this in future versions. I will close this issue.

Thanks for using our package and for your participation anyway.