Message-ID: <93d6f2a80905292052w5b40c8a0k96ff09262b0344e8@mail.gmail.com>
Date: 2009-05-30T03:52:14Z
From: Juliet Hannah
Subject: How to set a filter during reading tables
In-Reply-To: <4784.68.145.107.33.1243441630.squirrel@68.145.107.33>
One can use colClasses to set which columns get read in. For the
columns you don't
want you can set those to NULL. For example,
cc <- c("NULL",rep("numeric",9))
myData <- read.table("myFile.txt",header=TRUE,colClasses=cc,nrow=numRows).
On Wed, May 27, 2009 at 12:27 PM, <guox at ucalgary.ca> wrote:
> We are reading big tables, such as,
>
> Chemicals <-
> read.table('ftp://ftp.bls.gov/pub/time.series/wp/wp.data.7.Chemicals',header
> = TRUE, sep = '\t', as.is =T)
>
> I was wondering if it is possible to set a filter during loading so that
> we just load what we want not the whole table each time. Thanks,
>
> -james
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>