Maëlle's R blog

Showcase of my (mostly R) work/fun

What I edit when refactoring a test file

I’m currently refactoring test files in a package. Beside some automatic refactoring, I am also manually updating lines of code. Here are some tips (or pet peeves, based on how I look at it / how tired I am 😁) Prequel: please read the R packages book The new edition of the R Packages book by Hadley Wickham and Jenny Bryan features three chapters on testing, all well worth a read.

Automate code refactoring with {xmlparsedata} and {brio}

Once again a post praising XML. 😇 These are notes from a quite particular use case: what if you want to replace the usage of a function with another one in many scripts, without manual edits and without touching lines that do not contain a call to replace? The real life example that inspired this post is the replacement of all calls to expect_that(..., equals(...)), like expect_that(a, equals(1)), in igraph tests with expect_equal().

Reading notes on Producing open source software by Karl Fogel (First edition)

I recently re-read Nadia Eghbal’s Working in public. This time around, I noticed her mention of the book “Producing open source software” by Karl Fogel. It is a book about the people aspects of open-source projects, including money, and it reads like a sort of guide. Complying with my first-edition-curse, I did not notice there was a second edition online and soonish to be in print apparently, so I bought and read a second-hand first edition.

Load different R package versions at once with git worktree

This post was featured on the R Weekly highlights podcast hosted by Eric Nantz and Mike Thomas. Do you ever see GitHub issue comments where someone posts the results of a reprex with a current package version, and then with an older one, to prove a regression? How would you go about preparing such a report? Today I learnt there is a clean way to have different versions of a codebase at once on your computer, thanks to the ever powerful Git.

Reading notes on Pro Git by Scott Chacon

As mentioned about a million times on this blog, last year I read Git in practice by Mike McQuaid and it changed my life – not only giving me bragging rights about the reading itself. 😅 I decided to give Pro Git by Scott Chacon a go too. It is listed in the resources section of the excellent “Happy Git with R” by Jenny Bryan, Jim Hester and others. For unclear reasons I bought the first edition instead of the second one.