How to load a CSV of data in R

In R, it’s pretty important to be able to read in data from an external source. Here’s the simplest way you can read in data from a comma-separated value (CSV) sheet:

Read in a CSV
1
data <- read.csv("~/Desktop/data.csv")

The data in data.csv will be stored into a data frame called data, which can then be manipulated in R.