I love data, its in my blood, I love analysing, cleaning it and preparing it for others to use, still have to get to the last mile to displaying and visualizing it but that is a story for another day
2024 for me is the year of “automation”, for everything that I do. I have been polishing up my R skills over the holidays, as a way for moving into Python based data wrangling, however the challenges that I have faced is to do with getting my R scripts to run regularly - this has to be on a server connected to the internet since my laptop is not always on
I tried ShinyApps in the past, but this needed me to learn more things which I did not have bandwidth for.
So when Contabo my host wiped my dev VPS during the holidays, I had to re-build my sites, one of which was a documentation site built using PHP and markdown, which I wrote about Deploying a Tighten Jigsaw static site to a VPS using Laravel Forge I was deploying generated HTML to the VPS, then it hit me can’t I do the same with an R script
Install R on your server, here are steps to install R v4.x (I was able to get 4.3.2) https://medium.com/@hpgomide/how-to-update-your-r-3-x-to-the-r-4-x-in-your-linux-ubuntu-46e2209409c3
The domain does not really matter, use any custom sub-domain, even if it does not exist since we shall not be accessing this site anyway
Select Static HTML/Next.js/Nuxt.js
Select “website Isolation” where you specify a user name for the site, I tend to do this alot allowing me to do custom commands without using the global forge user
Firstly “Enable Quick Deploy” so that whenever you push code to the selected branch in Step #2 above the code is deployed
Customize your R script to be executed, in my case it was a simple as in the image below. I would also recommend keeping it as simple as you can to reduce deployment headaches
Laravel Forge is $12 per month for a single VPS, then costs $19 per month for unlimited servers