petermeissner

Re-exporting the magrittr pipe operator

… or how I stoped worrying and wrote a blog post to remember it ad infinitum.

Magrittr’s pipe operator is one of those newish R-universe features that I really want to have around whenever I put some lines into an R-console. This is even TRUE when writing a package.

So the first thing I do is put magrittr into the DESCRIPTION file and add an __imports.R file to the packages R/-directory with the following lines:

#' re-export magrittr pipe operator
#'
#' @importFrom magrittr %>%
#' @name %>%
#' @rdname pipe
#' @export
NULL

These lines import and re-export the pipe operator (%>%) therewith allowing to use it within my package but also beeing able to use it interactively whenever the package is loaded.

Best of all these lines will also ensure passing all package checks (CRAN complient) and preventing any “The following objects are masked from …” messages.

Last but not least the file name “__imports.R” serves two purposes (1) making the it appear at the very beginning of an alphabetical sorted lists of file names and (2) second giving it a speaking name to inform - however reads the file name - that some R “Imports” are most likely happening inside.

Happy coding!

PS.: Those lines above require the usage of roxygen2 as documentation framework.

Robotstxt Update - v0.6.0 on CRAN

I just got the news from the CRAN-team that the robotstxt version update 0.6.0 was accepted and now is available.

The robotstxt package aims at working with robots.txt files from within R by providing a parser as well as a permission checker - and some convenience goodies working behind the scenes.

This new version switches the default checking backend from an pure R implementation (done by myself) to a C++ implementation (done by Moz and wrapped by Bob Rudis) that is both executing much faster and also much more rigourous in interpreting the the standard (RFC). While it was hard to throw away so much of my own work it also is very liberating to now have to maintain lesser code and leaving the package with the feeling that it now is in a better state (more robust) than before.

Thanks CRAN, thanks Bob, thanks Moz.

Up and Running

Finally, I finished my search for a new framework to handle my personal webpage. You know something that would not involve too much semi-automatic pasting content into placeholders while all the time having it look like some second hand page from the late two-thousands.

I found it and I am happy so far: A Jekyll page with a simple but solid and elegant design by Niklas Buschmann.