1 Working Environment
To be able to work comfortably with R, we take care of the working environment in the first step. This includes R & Python, RStudio Desktop, and Git.
Last updated
To be able to work comfortably with R, we take care of the working environment in the first step. This includes R & Python, RStudio Desktop, and Git.
Last updated
R is an open-source software that is available for all popular operating systems. First, download the latest version of R for your operating system, and then proceed to install it.
Along with the language and interpreter for R, the installation also provides a rudimentary graphical user interface called RGui (GUI = Graphical User Interface). This consists of a simple console through which you can enter and execute R commands. The RGui is limited in its functionality and usability, and we'll be using RStudio Desktop instead.
Today, RStudio is the standard tool for working with R and provides many useful features. RStudio is an Integrated Development Environment (IDE) for R and even for Python. You can find a quick overview of the graphical user interface in the .
To download and install RStudio Desktop for your operating system, click the following link:
For those who want to take their first steps with R and don't want to go through the hassle of installing it, the cloud solution is ideal. RStudio offers free accounts that are limited to a certain usage time per month (25 hours) and computer resources (up to 1 GB RAM, 1 CPU). The advantage is that you can get started right away. The link below leads directly to the free registration:
Because of the limitations, I strongly recommend you use RStudio Desktop for this course.
Python is a widely adopted programming language and the de facto standard for machine learning applications. To run Python programs on our computer, you must install it first. You can download the latest version of Python from the following website:
On Windows, Python comes as an executable file with the extension .exe
. Save the file anywhere on your hard drive and double-click on it when the download has finished. When you do, the first window appears that looks similar to the one in the screenshot below:
Make sure you check the boxes "Use admin privileges when installing py.exe" and "Add python.exe to PATH". The former ensures that Python can write anywhere on your computer, which is important when you install packages later. The latter enables you to use Python from anywhere on your computer. We'll use Python mostly from the command line (or terminal), and with this setting, we can type python
regardless of which folder we are in.
Next, click "Install Now", no need to customize the installation. When the installation has finished, you see the following screen:
Click "Close" and you're done with this step.
Data Science projects often involve collaboration within a team, which requires the sharing of code among team members. This is analogous to working together on a text document or a spreadsheet with classmates. A helpful tool for this purpose is Git, which you will primarily use in this course to obtain the example code for the WordLens project from the designated GitHub repository. It is necessary to download and install Git on your computer to proceed with the course.
When you installed Git on your computer, you should be able to run the git command from any command line terminal. A command line terminal is a textual way to interact with a computer and issue commands, which is helpful to automate certain tasks.
You can use your operating system's integrated terminal, which on Windows is called the Command Line (cmd.exe
) and on macOS and Linux it is simply called Terminal. You can also open a terminal directly in RStudio, there is a tab named "Terminal" right next to the console. When you click on the "Terminal" tab, you should see your username and device name followed by the current path the terminal is in:
Switch to a path where you want to store the example code for this course. If you don't know how to achieve this from the terminal, read about cd
command, which is short for change directory. Make sure you use a short path that doesn't contain any spaces or special characters. Your "My Documents" folder is therefore a bad idea. I like to store all my R-code in the directory c:\rcode
and I create subdirectories for each semester and project.
Once you are in your desired directory, type the following command (use copy and paste) and hit ENTER. This will download a copy of the WordLens project's example code for this course to your computer:
After the command completed, you should have a new subdirectory wordlens-code
within the directory you ran the command.