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,898
  • 21
  • 55
  • 70

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
  • 360,940
  • 56
  • 644
  • 725