Our next R course is at University of Queensland (Australia) from 18th Feburary 2020. Beginner, intermediate and advanced classes available.
In the past I have primarily used the R inbuilt scripter for writing code and RStudio for teaching. My hope is that Atom will make life easier and will also be flexibile, but easy enough to use for teaching.
To help convince you about why switching to Atom is a good idea, here is an example of one of its cool features: Snippets
Atom Snippets allow you to type a shortcut and hit tab, and it will fill in the rest for you. One way to use Snippets would be to set up Snippets for common program structures, to save you time in re-writing them every time you start a new project
One of the most common things to do in R is to import data and manipulate it into a usable form. So here is a step by step guide for how to set up such a snippet in Atom
Atom is available here
Got to the 'Atom' menu and select 'Open your snippets'
Snippet code uses the .cson (CoffeeScript Object Notation) structure to delineate commands and code. Here is an example to create a common R script:
'.source.r': 'R data import': 'prefix': 'R_data_import' 'body': """ rm(list = ls()) setwd('') library(dplyr) library(tidyr) dat <- read.csv('.csv', header = TRUE) head(dat) """
The first line is the file type, the second line is the name, the third line is the shortcut name and the fourth line 'body' is the snippet. You can enclose multiline snippets in '"""' as I have done here.
Now, create a new file and save it with the '.r' (lower case is important) extension. When you start writing your file type 'R_data_' and a drop down box should appear. Scroll down and select 'R_data_import' and hit tab. It should auto-fill your script and you are ready to begin with some data wrangling.
If you want to evalute code you write in Atom, check out Atoms 'eval-r' package (OSX only).