This is definitely the most personal, and the most painful of my upgrading to R lessons. But first, here’s a basic outline of something that many first-time managers go through. I can guarantee something like this will happen if you’re managing a team upgrading to R.
In case you didn’t feel like sitting through that animation, here’s the bottom line: my team was doing great work upgrading to R, a mistake made it to a client, I WAY overreacted and burned a lot of goodwill that took a long time to get back.
Here’s a checklist to figure out if you’re in a similar situation  - You’re upgrading your team to a new technology (R).  - You have to keep doing real work while that transition happens.
That’s it. If you’re in that situation, mistakes are very likely to happen and likely to make it to someone who shouldn’t receive mistakes. You’ve got to prepare yourself and your team.
This is the obvious kind of preparation. Make sure that you’re doing everything you can to avoid mistakes.
Particularly if you’re in the business of producing data science insights (as opposed to making models for machines to use), the #1 best tool you have for catching errors is the data scientist or analyst’s brain. It’s sometimes possible to set up more formal error checking (e.g. unit or integration tests) in the style of software development. But more often, if you’re generating insights, the only way to know if what you’ve done is right is to examine the process. Here are a few ideas on how to make the process more ironclad.
It’s all too easy to churn out an analysis, finish up, breathe a huge sigh of relief, and send it off without thinking about how many 156 year-olds appeared in the data.1 Setting team norms (and putting together checklists or templates) for taking a close look through incoming data and examining outgoing analysis can make it way more likely that you’ll catch mistakes.
Code review is great – but if you’re creating insight products, this is more-or-less your last resort. And even then, I think the primary purpose of code review is to trigger thinking by the person who wrote the code, not for them to be handed insight from on high.
Institute good code review practices as soon as you can. This can be a hard one, as it’s tempting to believe that code review that doesn’t involve leaving comments on pretty red and green diffs on github isn’t real. But any review, no matter how low-tech is 1,000x better than code review that doesn’t happen because you’re waiting for the team to “get up to speed with git”.2
In fact, one of my favorite ways to do code review is to print out the code, read through it with the person who wrote it, and mark it up like an essay. Decidedly low-tech, but really engages the internal compiler.
But even if you do all the things above, failure at some point is almost inevitable. It’s kinda cliche at this point to say that failure is inevitable, and what matters is how you handle that. But as someone who knows that but still handled it badly as a team leader, here are a few tips I’d share.
The number 1 most important thing you can do is avoid overreacting.3 No matter how important the thing that’s messed up is, the long term health of the team is more important. It’s definitely hard to feel this in the moment, but this surely isn’t the only thing the team is (or will be) working on. Burning bridges with your team by overreacting, assigning blame, and creating draconian new rules that will stifle people’s work ethic is unlikely to lead to the outcomes you want.
To be a little more concrete: it’s impossible to overrate the effectiveness of generating solutions as a team. Blameless postmortems on any major milestone or serious error are a great thing to start today, and they are also the right way to recover from a serious error or mistake. Sitting with the team and emphasizing solutions (rather than blame) are the way to recover. In particular, I’ve found several times that handing solutions down from on-high is ineffective. Meeting as a team to come up with solutions work great – even when the eventual team solution is the same as the initial one that didn’t work!
A Coda: Book Recs
Two books I couldn’t recommend more strongly in this vein are Rising Strong by Brene Brown and High Output Management by Andy Grove. Brown’s book is a great exploration of failure and recovery. Trying to embrace the mindset in this book, even with frequent failures, has helped me be a much more empathetic and effective leader. Andy Grove’s book is a much more traditional “management” book, but his explanation of managing to task-relevant maturity is a great way to think about avoiding failure points whenever possible.