Import a csv into R

This can be done with this code
read.csv(“#file url here “) # You need to make sure to have a double backslash in the file path

So on my computer I went to the file location and then right-clicked and chose copy path. That gave

"C:\Users\caleb\Desktop\Stats\location.csv"

I then modified it to C:\\Users\\caleb\\Desktop\\Stats\\location.csv #not double backslashes

and so the final code is

read.csv("C:\\Users\\caleb\\Desktop\\Stats\\location.csv")

Or you could create an object

hospitals <- read.csv("C:\\Users\\caleb\\Desktop\\Stats\\location.csv")

Then a simple

plot(hospitals) #gives
Published
Categorised as Data, R