[R-pkg-devel] Nit-picky vignette questions

Brian G. Peterson brian at braverock.com
Thu Dec 8 21:55:44 CET 2016


In the text of a vignette, I always refer to them with links, just like
I would in other documentation:

\code{\link[xts]{to.period}}

and if I want to be explicit to the reader (who my be reading a format
where the links don't resolve, I would say something like:

see \code{\link[xts]{to.period}} in the \code{xts} package.

In code examples in the vignette, I would use

xts::to.period()

unless I had done a library() or require() call.

Regards,

Brian

On Thu, 2016-12-08 at 12:43 -0800, Roy Mendelssohn - NOAA Federal
wrote:
> Hi All:
> 
> In writing a vignette and referring to a function in another
> package,  say the function info() in the rerddap package,  it it
> better to refer to it as the "rerddap function info()" or as
> "rerddap::info()". This is for the vignette, not what I do
> internally.
> 
> Similarly in a code example in a vignette, if I am using the ggplot2
> function ggplot(),  which would preferable  (this is a non-working
> example just to show the alternative)
> 
>    require(ggplot2)
>    junk <- ggplot()
> 
> 
> or
> 
>   junk <- ggplot2::ggplot()
> 
> Yes these are nitpicky questions,  but as long as I am doing a
> vignette, I might as well try to do all of it in a way that is
> recommended or preferable.
> 
> Thanks for any thoughts,
> 
> -Roy
> 
> PS - Is there something like the Python related program flake8 for R
> code?   I have both Google and Hadley's style recommendations,  but
> it is nice  (though tedious and painful) to have a program that
> points out any inconsistencies from a recommended standard
> 
> **********************
> "The contents of this message do not reflect any position of the U.S.
> Government or NOAA."
> **********************
> Roy Mendelssohn
> Supervisory Operations Research Analyst
> NOAA/NMFS
> Environmental Research Division
> Southwest Fisheries Science Center
> ***Note new street address***
> 110 McAllister Way
> Santa Cruz, CA 95060
> Phone: (831)-420-3666
> Fax: (831) 420-3980
> e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/
> 
> "Old age and treachery will overcome youth and skill."
> "From those who have been given much, much will be expected" 
> "the arc of the moral universe is long, but it bends toward justice"
> -MLK Jr.
> 
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list