Two things I noticed through the course of trying to get this to work:
- When reading or writing the CSV, if you're using the "\" (backslash) character in the filepath, you'll actually need to use two of them consecutively for each instance (i.e. "\\" instead of "\") otherwise, R will think you're trying to escape the string and problems will arise
- When reading the CSV, I had to store the results of the read in the "mymap" variable like so:
Authored Comments
Very insightful and useful article Dorris!
Two things I noticed through the course of trying to get this to work:
- When reading or writing the CSV, if you're using the "\" (backslash) character in the filepath, you'll actually need to use two of them consecutively for each instance (i.e. "\\" instead of "\") otherwise, R will think you're trying to escape the string and problems will arise
- When reading the CSV, I had to store the results of the read in the "mymap" variable like so:
mymap <- read.csv("C:\\Users\\YourName\\Documents\\ApptoMap\\tweets.csv", stringsAsFactors = FALSE)
After doing this, I stopped getting errors and the map will plot properly as long as the CSV contains at least one longitudinal/latitudinal pair.