Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oxygenize R documentation #9

Closed
eblondel opened this issue May 5, 2014 · 4 comments
Closed

Oxygenize R documentation #9

eblondel opened this issue May 5, 2014 · 4 comments
Assignees
Milestone

Comments

@eblondel
Copy link
Member

eblondel commented May 5, 2014

To assess if the R documentation could be oxygenized using Roxygen or Roxygen2, where documentation will be added as comments within the R files, and Rd files generated automatically.

@eblondel eblondel added this to the 0.2 milestone May 5, 2014
@eblondel eblondel self-assigned this May 5, 2014
@eblondel eblondel removed this from the 0.2 milestone May 25, 2014
@Tungurahua
Copy link

I see the following pros and cons for using 'Roxygen2' for documentation:
Pro

  • Code and documentation are stored in the same file thus a switch between files is not needed.
  • Roxygen allows for automatic creation of 'NAMESPACE' and 'Collate' fields.
  • in my opinion Roxygen sources are easier to read than plain .Rd files. However that's certainly a matter of general preference.
  • Rstudio includes support (e.g tab-completion etc) for the fields available in .Rd files
  • Roxygen code resides in an .rscript file. In RStudio this means that code examples can be executed while writing the documentation with the same shortcut keys used when coding.

Con

  • automatic creation of NAMESPACEand collate might mean a loss of flexibility (though I don't see this at the moment
  • Using an additional intermediate step (use Roxygen to create .Rd files could be an additional source for systematic error. However I think Roxygen2 is widely used and reasonably stable.
  • automatic creation of .Rd files means that git staging area will get filled with .Rd files in the staging area while the change has been introduced only in the .r files. Solution might be to put the contents of the man folder into ignore.

@Tungurahua
Copy link

On R-bloggers Yihui Xie (knitRauthor) announces a package rd2roxygen that automatically converts Rd files to Roxygen. Might be worth a try if the move to Roxygen is to be taken.

The announcement has been released in 2010.

@eblondel
Copy link
Member Author

Thanks for to pointing to this package.. i will investigate on it. Roxygen seems to have many benefits, but i've also seen criticisms. This needs more assessment, and see how and when to move forward.

@eblondel eblondel removed their assignment Jul 23, 2014
@Tungurahua
Copy link

No worries. I didn't mean to push for roxygen in any way. As noted above Rd is the standard documentation format for R packages and roxygen - despite all convenience - is an additional linguistic layer that needs to be resolved to create the documentation. Or to put it simple: there might be bugs in the parser from roxygen to Rd. This alone is more than enough reason to be cautious. I think this issue is even raised somewhere in the roxygen vignettes where it's stated that Rd - though more difficult to handle - still has the greater flexibility.
I just ran across the post and wanted to note it down. This issue seemed to be a good place.

@eblondel eblondel added this to the 0.5 milestone Oct 19, 2015
@eblondel eblondel self-assigned this Oct 19, 2015
eblondel added a commit that referenced this issue Oct 26, 2015
eblondel added a commit that referenced this issue Oct 26, 2015
eblondel added a commit that referenced this issue Oct 26, 2015
eblondel added a commit that referenced this issue Oct 26, 2015
eblondel added a commit that referenced this issue Oct 27, 2015
@eblondel eblondel closed this as completed Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants