document v2.2.1

0

Monthly downloads

0th

Percentile

Run 'roxygen2' on (Chunks of) Single Code Files

Have you ever been tempted to create 'roxygen2'-style documentation comments for one of your functions that was not part of one of your packages (yet)? This is exactly what this package is about: running 'roxygen2' on (chunks of) a single code file.

Readme

Build Status Coverage Status CRAN_Status_Badge RStudio_downloads_monthly RStudio_downloads_total

document

Introduction

Please read the vignette.

Or, after installation, the help page:

help("document-package", package = "document")
# Document a Single R Code File
# 
# Description:
# 
#      Have you ever been tempted to create 'roxygen2'-style
#      documentation comments for one of your functions that was not part
#      of one of your packages (yet)? This is exactly what this package
#      is about: running 'roxygen2::roxygenize' on (chunks of) a single
#      code file.
#      This package enables you to
# 
#        1. create function documentation with 'roxygen2'
# 
#        2. detect code/documentation mismatches
# 
#        3. save the documentation to disk
# 
#        4. view the documentation in your interactive R session
# 
#      You will probably be looking for 'document' and 'man', the
#      remaining functions documented here are mainly for internal use.
# 
# Details:
# 
#      R is a programming language that supports and checks documentation
#      for program libraries (called `packages'). The package 'roxygen2'
#      provides a tool for creating documentation from annotated source
#      code - much like 'doxygen', 'javadoc' and 'docstrings/pydoc' do.
# 
#      And R is a free software environment for statistical computing and
#      graphics, used by people like me who start out hacking down code,
#      eventually pouring chunks of code into functions (and sometimes
#      even ending up creating and documenting packages). Along that work
#      flow you cannot use R's documentation system, let alone
#      'roxygen2', unless you have come to forge your code into a
#      package.
# 
#      I am fully aware of the fact that 'roxygen2' is meant to document
#      packages, not single code chunks. So should you. Nevertheless I
#      feel the temptation to use 'roxygen2'-style comments in code
#      chunks that are not part of any package. And to convert them to
#      pdf for better readability.
# 
# Warning:
# 
#      This package writes to disk, so *never* run as superuser.
# 
# Note:
# 
#      This package is basically a wrapper to
# 
#        1. 'roxygen2'. It internally creates a temporary package from
#           the code file provided (using 'utils::package.skeleton')
#           which it then passes to 'roxygen2::roxygenize'.
# 
#        2. 'R CMD' commands run by 'callr'.
# 
# See Also:
# 
#      'docstring' (<URL: https://cran.r-project.org/package=docstring>)
#      also creates temporary help pages as well but using a different
#      technical approach (allowing you to view them in the 'RStudio'
#      help pane). But it creates them from python style 'docstring'-like
#      comments it then parses into 'roxygen2'. And it does not write to
#      file so far.

Installation

You can install document from github with:

if (! require("devtools")) install.packages("devtools")
devtools::install_github("fvafrCU/document", quiet = TRUE)

Functions in document

Name Description
display_Rd Display the Contents of an R Documentation File
document-package Document a Single R Code File
Rd_txt_RUnit Clean a String Created From a Run Through RUnit
alter_description_file Alter Contents of a DESCRIPTION File
get_dpd A Convenience Wrapper
get_lines_between_tags Cut Code Chunks From a File
usage Return the Usage of a Function From Within the Function
warn Throw a Warning
is_Rd_file Check Whether a File is Probably an R Documentation File
man Display a Help Page From a File's Documentation
check_package Run R CMD check on a Package Directory
clean_description_file Make a Default DESCRIPTION File Pass R CMD check
write_the_docs Read R Documentation Files from a Package's Source, Convert and Write Them to Disk
document Document (Chunks of) an R Code File
fake_package Fake a Package From a Single Code File
sort_unlocale Sort a Character Vector in Lexical Order Avoiding the Locale
throw Throw an Error
No Results!

Vignettes of document

Name
Introduction_to_document.Rmd
No Results!

Last month downloads

Details

License BSD_2_clause + file LICENSE
URL https://github.com/fvafrCU/document
Encoding UTF-8
LazyData true
VignetteBuilder knitr
RoxygenNote 6.0.1
NeedsCompilation no
Packaged 2018-01-13 22:13:42 UTC; qwer
Repository CRAN
Date/Publication 2018-01-13 22:45:11 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/document)](http://www.rdocumentation.org/packages/document)