Programmer's confidence

August 16, 2021
R advanced-r-solutions personal

It’s the middle of August now and the book (“Advanced R Solutions”) my friend Malte and I have been writing in our spare time is currently being printed. If you’re interested in obtaining a hardcopy, you may already (pre-)order - the book will be shipped in a few days:

We started the project a few years back shortly after the {bookdown}-package came out. We both had used R for a while, enjoyed data analysis, and wanted to develop our technical skills. Advanced R is a great resource and it introduced us to a lot of concepts that helped us understand R’s design and behavior more deeply.

Today, I’d like to take the chance to reflect a little on how I went about working through Advanced R and what I take away from the experience.

The cover shows all 284 exercises in in 20 chapters.

Figure 1: The cover shows all 284 exercises in in 20 chapters.

The writing process

When I was solving exercises I typically read the exercise carefully and re-read the related Advanced R chapter or section. Hadley did such a good job of presenting the content, that this step was usually quick and fun. I then started to write some code, look at R’s excellent documentation or do a web search for questions I had. Once I had a rough idea of the solution, I usually adding explanations. I often reworked the solution in a second session or the following day, which helped improve the quality, I hope. Whenever I got stuck I handed the question over to Malte so he could have a shot and we also paired on a couple of exercises. It continues to amaze me, how much easier it is to make progress on tougher challenges when you have someone to exchange ideas with directly!

But to me, the main challenge of the project was not solving the exercises. I found early on that given enough time and the possibility to consult Advanced R or discuss an exercise, I could solve most of the exercises. To me, the main challenges had more of an ‘organizational’ nature.

A big challenge was simply making enough time for the project. I do a lot of programming in my day job already and sitting down on the weekend to do some more is okay on some weekends, but it’s a burden on others. The kind of ‘relaxed concentration’ I like to have for studying and writing is a scarce resource and it also needs rest to be maintained. I think I learned a lot about how much time I like to spend in front of my computer and when I need to turn it off. As the project continued I started to work less on evenings and weekends and more during short holiday breaks and for me, this was a good choice! Having a four-day workweek for short while also helped a lot.

Another challenge was writing the book t o g e t h e r. In the end, the collaboration made it possible for us to succeed, but it also meant synchronizing approaches and schedules. Is it okay to commit a half-baked solution to the repo? Should the prose sound more formal or colloquially? Who will tackle which chapters? When is a solution good enough? It also meant accepting that life can change your priorities quickly and work on a side-project may not be that important for a while.

We also had to cope with a major setback. When we were more than halfway through the first edition of the book Hadley started a rewrite and updated a lot of the chapters of the book. Many of the questions stayed the same, but the solutions mostly needed to be rewritten anyway. We took a break, eventually recommitted, and slowly got back on track. Having clear assignments and a general sense of progress, which we achieved by plotting all exercises and marking them open/in progress/done, also helped to pick up and sustain momentum.

Celebration time!

And now it’s done! The book is already online ( and I look forward to holding a physical copy in my hands (and giving one to my parents ^^). When I look back, I tend to think of this adventure somewhat like a ‘coming-of-age project’ as a self-taught programmer. I’ve been exposed to useful technical concepts (such as R’s copy-on-modify rules, general error handling, function factories, metaprogramming, …), and even after a couple of months, these are still there in the back of my mind. But it’s easy to forget the more technical stuff when you don’t use it daily and that’s okay.

Most of all, I think, that going through the exercises has given me some kind of * programmer’s confidence*. I’m more optimistic now, that I can solve a more difficult technical problem and I’m more relaxed when I break it down and try to solve it one step at a time. I know, when to step away for a while and that it may take some time to find a good solution. A new error is already a step forward! :)

It also feels great to have the project off my mind and to have the freedom to move on. It’s been a lot of fun, a lot of work and a great ride overall. And if you enjoyed (some parts) of the book of the book or it has helped you, please let me know.

Regression Modeling for Time Series

May 3, 2018
R timeseries forecast gtrendsR huxtable


April 1, 2017
R rusergroup japan
comments powered by Disqus