4

Possible Duplicate:
Only read limited number of columns in R

I have a ascii-dataset which consists of three columns, but only the last two are actual data. Now I want to dotchart the data by using read.csv(file = "result1", sep= " "). R reads all three columns. How do I avoid this?

Community
  • 1
  • 1

1 Answers1

9

You can use the colClasses argument to skip columns:

mydata <- read.csv('mydata.csv', colClasses=c('NULL',NA,NA))

or

mydata <- read.csv('mydata.csv', colClasses=c('NULL', 'numeric', 'numeric'))
Greg Snow
  • 45,559
  • 4
  • 73
  • 98