Skip to content

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

3 messages · Roy Mendelssohn - NOAA Federal, Brian G. Peterson, Thierry Onkelinx

#
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.
#
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 Roy,

Have a look at the lintr package:
https://github.com/jimhester/lintr/blob/master/README.md
It works stand alone and integrates with several editors.

Best regards,


ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

2016-12-08 21:43 GMT+01:00 Roy Mendelssohn - NOAA Federal <
roy.mendelssohn at noaa.gov>: