Motivation
One of the main reasons we've purchased RStudio Server Pro is to make it as easy as possible for our employees to be productive using R at work. As an R admin, I want to make the path from "I want to use R at work" to "I'm using R at work productively" as short as possible. Without RStudio Server, a potential new R user has to do all of the following before they're ready to do analysis on actual company data:
- Install R on their machine
- Install RStudio Desktop
- Configure R to point to our internal package repository
- Install database drivers
- Figure out how to connect to a database
- Figure out how to get data out of the database into R
Just having RStudio Server Pro allows me to replace steps 1 - 4 with "go to this URL". That's great! But can I do something to help with 5 and 6 as well?
Making better default connections
In RStudio Server's Connections pane, when you click "New Connection", you see a list of the ODBC drivers that are installed and clicking on one leads to a prompt for the necessary connection details.
Like most companies, we have a couple of big databases that hold the majority of data a user might be interested in accessing. And I know what the server name, port, etc is for those databases, so wouldn't it be great if I could fill in that box that pops up, so that new users don't have to chase down all of the connection details? Well, it turns out I can.
Following the guide here (specifically the part about Snippet Files), I added named connections for our company's most commonly used databases.
Here's a screenshot of "New Connection" menu after I created /etc/rstudio/conections/Analytics Data Mart.R
per the instructions linked above.
So now the path from "I want to use R at work" to "I'm using R at work productively" has just 3 steps:
- Go to my-rstudio-server-DNS in your browser and log in
- Select a connection from the Connections pane and connect to a databse
- Figure out how to get data out of the database into R
Next I'm working on a First Project Template to make step 3 as smooth as possible for new users!