1

I am trying to build an R package. But now my function has used some function from package stringr. Could anyone tell me how can I add stringr in to my package? Thank you.

nick
  • 1,090
  • 1
  • 11
  • 24
Codezy
  • 662
  • 5
  • 17

1 Answers1

2

The function you have used should be added to roxygen documentation. For example, if you used the function stringr::str_extract(), you can add-

#' @importFrom stringr str_extract()

And then run roxygen2::roxygenise() and you should see this function added to your NAMESPACE file. You can read about this in Hadley Wickham's (freely available book on how to make R packages): r-pkgs.had.co.nz/namespace.html

Or see this playlist: https://www.youtube.com/playlist?list=PLk3B5c8iCV-T4LM0mwEyWIunIunLyEjqM

Indrajeet Patil
  • 4,673
  • 2
  • 20
  • 51