Reputation: 4302
I am executing this line of code to import a file
flowers <- read.csv("http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data")
149 rows come in. The problem is that there are 151 rows in the original dataset. When I look at the unique values for the last column (#5), the 2 rows with a "NA" are getting dropped:
unique(flowers[,5])
What do I have to do to include those 2 rows?
Upvotes: 2
Views: 58
Reputation: 887911
You can use blank.lines.skip=FALSE
in the read.csv
to get the blank lines as well
flowers <- read.csv("http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data",
blank.lines.skip=FALSE)
Upvotes: 2