Blog

Thank you, 2019!

Jan 1, 2020 | 9 minutes read
Share this:

No doubt 2019 has been a good year. As a personal project, I have launched a Shiny Server, which is run in a very basic droplet in DigitalOcean. There are currently three free apps available in the server: Critical Power Dashboad, Lactate Dashboard, and VO2 Kinetics Dashboard. They were all updated and improved this year. In total, my personal website and my shiny server had an outstanding number of visitors in 2019: 3,717 users from 68 countries.

My shiny adventure started with Critical Power Dashboard, about 2 years ago. I had just started my PhD at the University Hospital of Tübingen, in Germany, when I published my last paper from my MSc in Canada. In this paper, we described how different mathematical models and different lengths (and combinations) of time-to-exhaustion (TTE) trials could affect critical power estimations in cycling. Given the number of possible models and different combinations of TTE trials in each model, we ended up with 74 different results for each participant. Since we had 13 participants, it means that in total I had to model critical power 962 times. That is right. 962 times. 962. Why is it impressive? It is because I did it everything manually using OriginPro. After I was done with this analysis, I said to myself: “I am going to learn programming”. It was the first time I realized that absolutely no one should do this manually. It is too much time wasted. What if we had decided to do something different in the end? That would mean I would have to do 962 critical power estimations again. Changing a single line of code and pressing Enter again sounded much more reasonable.

Anyways, coming back to my shiny adventure, we had just published this paper when we received an email on January 5th, 2018, from Prof. Simon Jobson from the University of Winchester asking whether we had an easy-to-use spreadsheet to derive all those estimations we used in the paper. Well, we didn’t. But challenge accepted! My first attempt was doing this in Excel using a macro. It is actually quite impressive what you can achieve exploring the VBA functionality. After some days the macro was working quite good. It was a lot of work behind it, so I emailed my colleagues to share the good news. It was then when we found out that Excel macros are only guaranteed to work if the person on the other side has the same Microsoft Office version and the same operating system as you do.

At that time I had just started learning R, and I had heard of this amazing Shiny platform that you could build web apps. The first time I visited the R Shiny Gallery it literally blew my mind that you could do that with R. So after this Excel macro let down, I realized that maybe this was the best chance and excuse to learn how to build a Shiny app. Once again, challenge accepted! I started checking learning materials, tutorials, and reading the code from other apps. After a few days, the basic code was already working nicely. However, for some reason, I could never display the results on the screen. I guess it took me perhaps 3 weeks working on it in the evenings trying to break the problem down. The problem is that I still didn’t have a very good understanding of what exactly I was doing in general. I was just learning by doing. And what a rollercoaster that is!

After a lot of trial and error, on April 23rd, 2018, I sent the very first version of the Critical Power Dashboard to our group in Canada. From that on, Federico Fontana, Louis Passfield, Juan Murias, and I spent a lot of time testing the app with different data, comparing the results from other software, and discussing user interface design. After a lot of testing and adjustments, we were finally happy with the result and we then sent Prof. Simon a link for him to give it a try too. He then requested one of his PhD students at that time, James Wright, to test the app with the data he was collecting for his PhD and to compare the results from the app with his own. James gave us valuable and precise feedback, which helped us to improve the app even more.

From that time on, we shared the app with a couple of friends, but we weren’t quite sure how the app could be deployed in order to share it more widely. We were using shinyapps.io, which allowed 25 hours of usage per month for free. At some point, the 25 hours were not enough anymore. We needed an alternative. That is when we got some advice from John Holash, which is an IT expert and he was also doing his PhD at the University of Calgary back then. Over the course of 2018, I read more about deployment alternatives and in October I decided that creating my own server could be a really good option. I could create mine in DigitalOcean following this amazing tutorial written by Dean Attali. In one day my Shiny Server was up and running. After some headache setting up nginx everything seemed to be in its place.

However, it was not until March 5th of this year that I decided to post something about the app on Twitter. After this first tweet, the app got more attention and users around the world.


With the number of visitors of Critical Power Dashboard growing I felt like these tools could be indeed useful. After reading this paper from Prof. David Bishop’s group, I thought that we were still missing an easy-to-use and free tool out there to calculate lactate thresholds. Having an app that could easily calculate lactate thresholds using different methods from your data could be nice. After two weeks working on it during my free time, Lactate Dashboard was ready. It had two main advantages: i) after setting up the protocol used in your incremental test, you can simply copy and paste your data into a table (no need to set up your data into a special format and then upload it to the app); and ii) additionally to the normal export options, you can also generate an HTML report with all the results.


After releasing Lactate Dashboard, I had to move on to the next app. Yes, I can never stop. Following my many hours working on OriginPro during my MSc in Canada performing VO2 kinetics analyses, I always wanted to create something to automate this process. This kind of analysis require many steps, which absolutely all of them can be fully automated. Unless, of course, you analyze VO2 kinetics in the heavy- or severe-intensity domains, which it will require a little more thought from the person analyzing it. Anyways, this third app is still under construction, but already available online. I also need to confess that I haven’t done much maintenance on the app since its release - hence, its low number of users.

VO2 Kinetics Dashboard was released on June 14th, and it will go through a major update in this upcoming year.


Last but not least, one of the big discoveries I had this year was the work from Colin Fay (and the whole amazing ThinkR team) and David Granjon. Colin and the ThinkR team are the authors of the {golem} R package. {golem} has the main goal to provide you tools to create robust Shiny apps. It does so by building your Shiny app as a package, and it also has incredible tools to work with shiny modules and to easily deploy your app in many platforms. When I first heard about {golem} I was speechless. What a great time to be a shiny developer! Likewise, David is the author of the {bs4Dash} R package. {bs4Dash} brings a whole new level to your UI design. It implements Bootstrap 4 into your app. After giving {bs4Dash} a first try I thought: I finally found the optimal design for my dashboards.

Therefore, I also worked on some branding for the apps. I was still missing a nice logo for each one of them. During the major update on Lactate Dashboard, I was also updating the homepage of my shiny server and I found this bootstrap template that had some nice icons in it. Then, inspired by the design of these icons, I created the ones I now use:

On September 16th the major update on Lactate Dashboard was ready:


Followed by the major update on Critical Power Dashboard on November 22nd:


This upcoming year, besides a major update on VO2 Kinetics Dashboard, I am planning on releasing other two apps: VO2max Dashboard and NIRS Dashboard, and also an R package.

Finally, I just would like to thank everyone in the #rstats community and everyone that made this personal project possible! The year 2019 was great, and I hope 2020 will be even better!