简体   繁体   中英

Can I generate .Rd files without roxygen2 annotations

Is it possible to generate .Rd files for R functions without manually writing roxygen annotations?

I know one method is to use prompt() but this does not look at arguments or return values.

Can it done through any other command or with RStudio?

Yes, you can just write the files by hand, like most of us did for a long time. See Writing R Extensions for details on the format.

You can source the scripts you want to create a package out of and then use the command

package.skeleton(name = 'MyPackage')

This will create a package based on everything in your current environment so make sure your environment only contains what is necessary to create your package. If you are using devtools (which I recommend you do) then do this outside another folder. This will create a "man" folder that contains .Rd files that serve as the basic template for everything that you sourced that requires documentation. This would save some time as opposed to writing them all by hand.

If you are using devtools, then copy these files into the other 'man' directory in your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM