jahed
jahed

Reputation: 169

Importing CSV-files in R

I'm trying to load a csv-file into R, but fail. This is what I write:

airports <- read.csv(”~/Documents/TestRCSV.csv”, header=TRUE)

But I get the error:

Error: unexpected input in "airports <- read.csv(‚"

I use Mac, and I tried using the complete pathway with the same result. What do I do wrong?

Upvotes: 0

Views: 128

Answers (1)

hd1
hd1

Reputation: 34657

You're missing path.expand... Use:

 airports <- read.csv(path.expand("~/Documents/TestRCSV.csv"), header=TRUE, stringsAsFactors=FALSE)

Let me know if you have further problems.

Upvotes: 2

Related Questions