[R] import text file into R

Jim Lemon jim at bitwrit.com.au
Fri Jun 4 10:46:42 CEST 2010


On 06/03/2010 09:32 PM, dhanush wrote:
>
> can anyone tell me how to import a text file in R? the text file I want to
> import is a large file, about 800MB in size. Thanks in advance.
>
> I tried using the following
>
> data<-read.table("file",header=T,sep="\t")
>
>
Hi dhanush,
If the problem is with read.table, maybe:

# "whatlist" is a list of data types defining what
# is in each line of data - see the help page
data<-scan("file",skip=1,sep="\t",what=whatlist)

will get it in for you.

Jim



More information about the R-help mailing list