As usual, first I want to thank my employer RStudio for giving me the freedom to work on this book. Since I started working on it, my weekly meeting time with my manager, Tareef Kawaf, was first reduced from 15 minutes to 5 minutes, and then the meetings were just canceled. I have heard from several friends that they have too many unbearable meetings in their institutions, which waste a lot of their time. In terms of managing distractions, one of them recently lamented, “You may be able to mute Slack for five minutes, but can you possibly mute it for a whole day?” “Of course, I can!” I told her. I can probably mute it for a whole month if I like. Do not get me wrong—I do not mean Tareef or my colleagues are distractions. I only mean how much freedom they can offer me.
I came up with the idea of writing this cookbook after I published the R Markdown Definitive Guide, but ideas are often cheap. It is the execution that is hard and expensive. If it were not for Michael Harper’s initial pushing, I would never start working on it seriously. Christophe Dervieux has always been around whenever I need help. He used his R and R Markdown skills to build a dashboard (with the flexdashboard package) to guide me to the potentially interesting and useful topics to write on. Meanwhile, he has also helped me in numerous other GitHub issues, so I could have more time for writing the book, instead of spending whole days on wrestling with bug reports that do not have minimal reproducible examples attached. Similarly, several people have been helping with answering R Markdown questions on Stack Overflow, including Martin Schmelzer, Marcel Schilling, and Ralf Stubner, etc. Perhaps it was not their intention to save me time, but their effort did save me a lot of time. Recently Johannes Friedrich also came to my attention on Stack Overflow, after a few times when I opened a new Stack Overflow question only to find it already answered by him.
David Keyes saved my life in Section 10.3, since he had written a wonderful blog post to introduce several R packages to create tables, with which I was not very familiar. Other online materials that have helped me a lot include: Holtz Yan’s post on some R Markdown tips, Nicholas Tierney’s book “R Markdown for Scientists”, Maëlle Salmon’s R Markdown course, Jennifer Thompson’s R Markdown course, Emi Tanaka’s R Markdown workshop, Alison Hill’s R Markdown workshop (co-taught with me), and Alison Hill and Emi Tanaka’s R Markdown workshop.
Many people have made contributions in the GitHub repository of this book by either sending pull requests or filing issues, including Maria Bekker-Nielsen Dunbar, Nathan Eastwood, Johannes Friedrich, Krishnakumar Gopalakrishnan, Xiangyun Huang, Florian Kohrt, Romain Lesur, Jiaxiang Li, Song Li, Ulrik Lyngs, Matt Small, Jake Stephen, Atsushi Yasumoto, Hao Zhu, and John Zobolas.
The original idea of this book was partially motivated from a remote talk that I delivered to the RaukR Summer School in 2018, in which I introduced some lesser known features of knitr. The audience seemed to like those short introductions of knitr features, which were like recipes. I’d like to thank the organizers of the summer school, including Marcin Kierczak and Sebastian Dilorenzo, for inviting me. I have given similar talks later at Genentech and DahShu. I want to thank Michael Lawrence and Yuqing Zhang for the invitations, as well as the audience of these talks for their feedback. Paul Johnson published a very helpful critique of our book R Markdown: the Definitive Guide on the journal The American Statistician in 2020. He complained that the book lacked in-depth examples, therefore the definitive guide was not definitive enough. I truly appreciate and agree with his comments. I hope this new (cook)book could fill the gap.
This is the fifth book that I have published with my editor John Kimmel. It has always been a pleasure to work with him and the team at Chapman & Hall/CRC. I’m excited every time John tells me the new success of bookdown as it is more widely adopted by other authors. I feel honored to hear from John that Suzanne Lassandro, the copy-editor of my previous books, still tried hard to help with this book even though she has many other responsibilities and rarely works directly with authors now.
John reached out to several reviewers for their feedback on the manuscript. Eventually we received nine great reviews. One of them was so great that we could not help inviting her to co-author this book! It was a lot of work to deal with the nine reviews, but it was definitely worth the effort. I’d like to thank all these reviewers for their helpful feedback, including Carl Boettiger, John Blischak, Sharla Gelfand, Johannes Friedrich, Atsushi Yasumoto, and other anonymous reviewers.
I worked on the last part of this book in the vacant house (without Internet!) of my good old neighbor, Dong Guo and Qian Jia, after they moved to another city. I’m grateful to them for letting me use their house as my temporary office to finish up the book when I felt rather exhausted and needed a quiet environment. It was sad to say goodbye to them. To me, this book, finished in their house, will also be associated with some of my fond memories about this family, including their parents and lovely little daughter.
Lastly, I will definitely not miss this unique opportunity to thank my two little “super helpful co-workers” (5 and 3) at home during the COVID-19 pandemic, without whom I could have published this book five months earlier. Now I miss the teachers at their daycare center (Small Miracle) and feel daycare centers are perhaps not that expensive…