Articles by Posts on R-hub blog

Code generation in R packages

February 9, 2020 | Posts on R-hub blog

If you use the same code three times, write a function. If you write three such related functions, set up a package. But if you write three embarrassingly similar functions… write code to generate their code for you? In this post, we’ll deal with source code generation. We’ll ... [Read more...]

Code examples in the R package manuals

January 26, 2020 | Posts on R-hub blog

After posts exploring READMEs, URLs in DESCRIPTION, today we shall look at another important aspect of documentation: examples in the manual pages of your functions! Why write them, how to write them, and how to control their execution in different contexts (CRAN or not ????). Why write examples in manual pages? ... [Read more...]

Objects that feel mutable in R

January 21, 2020 | Posts on R-hub blog

In R, most often, to change an object, you need to re-assign its new value to it. But sometimes, things feel different because objects are mutable or it seems they are, be it in base R code or in the code of packages. Why and how to provide a mutable ... [Read more...]

R-hub usage in a few figures

December 18, 2019 | Posts on R-hub blog

Earlier this year when launching this blog we explained why R package developers should care about R-hub. So, does anyone care? ???? Yes! Let’s summarize R-hub usage. Usage data As specified in our use terms we do not store user data. However we do store some usage data. In the ...
[Read more...]

Internal functions in R packages

December 11, 2019 | Posts on R-hub blog

An R package can be viewed as a set of functions, of which only a part are exposed to the user. In this blog post we shall concentrate of the functions that are not exposed to the user, so called internal functions: what are they, how does one handle them ... [Read more...]

About URLs in DESCRIPTION

December 9, 2019 | Posts on R-hub blog

Among DESCRIPTION usual fields is the free-text URL field where package authors can store various links: to the development website, docs, upstream tool, etc. In this post, we shall explain why storing URLs in DESCRIPTION is important, where else you should add URLs and what kind of URLs are stored ... [Read more...]

The Rt of good package READMEs

December 2, 2019 | Posts on R-hub blog

A recent topic of the Write The Docs’ great newsletter was READMEs. It read “As they’re often the first thing people see about a code project, READMEs are pretty important to get right.”. In this post, we’ll share some insights around the READMEs of R packages: why they’...
[Read more...]

Search and discover CRAN packages with pkgsearch!

November 25, 2019 | Posts on R-hub blog

We have just released version 3.0.1 of the pkgsearch package on CRAN! ???? pkgsearch munges CRAN metadata and lets you access it through several lenses: search packages by keyword, popularity, recent activity, package name and more. Get pkgsearch’s latest version from a safe CRAN mirror near you: install.packages("pkgsearch") This ...
[Read more...]

Mocking is catching

October 28, 2019 | Posts on R-hub blog

When writing unit tests for a package, you might find yourself wondering about how to best test the behaviour of your package when the data it’s supposed to munge has this or that quirk, when the operating system is Windows, when a package enhancing its functionality is not there, ... [Read more...]
1 2

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)