1

Possible Duplicate:
Only read limited number of columns in R

I have a data text file with a million observations and 150 variable (v1 to v150) delimited by semicolons. I need only a selected handful of variables. Is there any way to read in only the variables I need? I am using read.table("filepath/filename.txt", sep=";", header=T). If there is any other way than read.table() with which this can be done?

Community
  • 1
  • 1
user702432
  • 11,190
  • 18
  • 53
  • 69

1 Answers1

6

See help(read.table) and particularly the colClasses argument. Simply set the columns you want to ignore to NULL and they will be skipped.

Dirk Eddelbuettel
  • 347,098
  • 55
  • 623
  • 708