GitHub Copilot in R-Studio
GitHub Copilot is an AI pair programmer that offers autocomplete-style suggestions as you code. It is possible to integrate GitHub Copilot into R-Studio to speed up annoying coding tasks and get suggestions for code snippets.
Setup
To make the Copilot available in RStudio, you either need to have a subscription to GitHub Copilot, or (recommended) a GitHub Education account. It is free for students and faculty members. To get GitHub Education, you might need to upload a certificate showing that you are either a student, or affiliated with an university. For IQB-Members, it might be enough to upload a confirmation of your employment as researcher at the IQB, which you could request at IQB-Personal.
After obtaining some sort of confirmation, you can follow this guide or this guide to connect GitHub Copilot with RStudio.
Usage
After installation, Copilot will make code suggestions, which you can accept by pressing Tab
. Enter/Return
will ignore the suggestion. If you want to give Copilot some additional instructions, you can just write them into a comment over the line you want the code suggestions in:
Generally, the suggestions work best for smaller, compartimentalized problems.