1

So I am working on compiling a package using the latest Rtools within RStudio.

I am getting this warning and suggestion:

Consider adding
    importFrom("stats", "IQR", "median", "na.omit", "quantile", "sd",
               "shapiro.test", "var")
    importFrom("utils", "read.csv", "write.table")
  to your NAMESPACE file.

I would like to add such functions as na.omit as they suggest in the NAMESPACE file.

However, that entire file gets auto-generated by roxygen2. So how can I add them.

Can I add the importFrom syntax in the DESCRIPTION file?

Adding it to each function maybe a solution, but doesn't seem to be optimal.

Why roxygen2 doesn't have the file split into a MANUAL and auto-generated section is beyond me.

How to manually add importFrom to NAMESPACE when roxygen2 auto-generates the file?

Spacedman
  • 92,590
  • 12
  • 140
  • 224
mshaffer
  • 959
  • 1
  • 9
  • 19
  • Run `devtools::document()`. You may find this useful. https://laderast.github.io/2019/02/12/package-building-description-namespace/ – Phil Sep 10 '20 at 21:47
  • I am using the GUI which calls devtools::document() ... the link was useful. I ended up replacing na.omit with stats::na.omit ... trying to reference "rvest" syntax with the chaining '%>%' notation ... getting this warning/error: no visible global function definition for '%>%' – mshaffer Sep 11 '20 at 02:51
  • What if you add `@importFrom magrittr %>%` to your R script file to define your function(s)? https://stackoverflow.com/questions/58026637/no-visible-global-function-definition-for – Phil Sep 11 '20 at 04:17
  • Thanks, I was trying this `@importFrom rlang .data` – mshaffer Sep 11 '20 at 07:01
  • I got it to compile, have a notice: `unable to verify current time` – mshaffer Sep 11 '20 at 07:03
  • is there a way to force the homepage of the help files to organize functions by `@family` ? – mshaffer Sep 11 '20 at 07:06
  • Regarding the `unable to verify current time`, does this help? https://stat.ethz.ch/pipermail/r-package-devel/2019q1/003577.html – Phil Sep 11 '20 at 14:11
  • Q re: `@family` I don't know, I've never dealt with that. – Phil Sep 11 '20 at 14:12

0 Answers0