Seting Up Your Environment
1 Cloud Solution
Cloud solution means that you don’t need to install anything on your computer. You can run R code directly in your web browser. This is the easiest way to get started without worrying about installation issues.
But soon enough, you will realize that the cloud-based solution is limited in:
compute power: 1 CPU core, 1 GB RAM
execution hours: 25 hours per month;
slow performance
AI integration is better in local environment
GitHub Copilot is a powerful AI tool that offers autocomplete-style suggestions as you code. The tool can give you suggestions based on the code you want to use or by simply inquiring about what you want the code to do.
It is developed by GitHub in partnership with OpenAI, and it is designated to best assist developers in writing code more efficiently.
Some of its highlight features include:
- Code autocompletion: generating suggestions while typing the code.
- Code generation: Copilot will use the context of the active document to generate suggestions for code that might be useful.
- Answering questions: it can also be used to ask simple questions while you are coding (e.g., “What is the definition of mean?”).
- Language support: supports multiple programming languages, including R, Python, SQL, HTML, and JavaScript.
To enable Copilot in RStudio: click on Tools → Global Options → Copilot → tick the box saying “Enable GitHub Copilot” → sign in to your GitHub account, and there you go; you are ready to start!
GiHub Copilot free plan has limited usage: 2000 code autocompletions per month, 30 code generations per month, and 30 question answers per month.
Soon enough, you will realize that you need more than that. Because every character you type counts as usage, regless of whether you accept the suggestion or not.
🎈 The good news is: You can use Copilot Pro for free if you are a student!
See Apply to GitHub Education as a student.
If you wonder anything, look up in GitHub Copilot Documentation.
Nonetheless, here are two popular cloud solutions:
Google Colab: good support for Jupyter Notebooks
.ipynb
.We will use Jupyter Notebooks in this course.
RStudio Cloud: basic emulator for RStudio IDE in the cloud.
1.1 RStudio Cloud
Once in the dashboard, you can click on the New Project - New RStudio Project to get started:
Once the new project is created, you will see the RStudio IDE interface, which is similar to the one you would find in RStudio Desktop. You can write and execute R code, create scripts, and manage your projects directly in the cloud.
2 Local Solution
2.1 RStudio Desktop
RStudio Desktop is a free and open-source integrated development environment (IDE) for R. It provides a user-friendly interface for writing and executing R code, making it easier to work with R scripts, data analysis, visualization.
To install RStudio Desktop, follow these steps:
- Install R
- Install RStudio Desktop
Go to RStudio Desktop Download and download the installer for your operating system (Windows, macOS, or Linux).
ref: