How to document and install the package when making own package

I tried to make my own R packages including the function.

I used the R studio based on R 4.2.2 version and also downloaded RTOOLS42.

I made the new directory in R studio. (just click the black arrow at the top of the right side)

The directory name is geJSD.

And I used this code to make the package.

library(devtools)
use_r("addSE")
use_r("subSE")

And I wrote the script for them including the title, description, code and so on.

Then, I tried to document the script.

I used Build-more-documentation but it didn’t work. The error message pops up. This is the error message.

enter image description here

Indeed, when I typed the code devtools::document(), the pdf files were created under the man file.

And I tried to use the install and restart package to make the package.
But it didn’t work either. The error message recommends removing the geJSD package in win-library/4.2 folders. But there is no geJSD folder.

enter image description here

enter image description here

I used the check function. This is the result.

enter image description here

I struggled to make the package, especially how to install the package.
Please help me 🙁

If you have any idea to solve this problem, could you give me some advice?

  • 1

    Instead of creating links to images, can you just include the code/output here on SO please.

    – 

  • Did you run devtools::create() at some point to initialize the package? Like do you have a NAMESPACE and DESCRIPTION file in your package directory? When you run load_all('.') what is your current working directory? There are a lot of details here and pictures of code aren’t that helpful

    – 

  • Oh my goodness. Thanks to your comment, I realized I didn’t use devtools::create() function. And I restarted to make the package. By using devtools::create() at the beginning, all problems are sorted. Thanks.

    – 

Leave a Comment