You can read in a list:
DF <- lapply(dir(patt="file.*\\.txt"), read.table, sep =
";", header TRUE)
names(DF) <- paste("data", seq_along(DF), sep = "")
DF[["data1"]]
On Wed, Sep 3, 2008 at 7:52 AM, Sigit B Wibowo <sigitbw@gmail.com> wrote:
> Dear all,
>
> I am new in R. I want to read data which is vector from many files and
> import to many object.
> For example I have 10(ten) files.
> file1.txt
> file2.txt
> :
> :
> file10.txt.
>
> I want to import each file into one object as follows.
> data1
> data2
> :
> :
> data10
>
> I want to import file1.txt into data1, file2.txt into data2, and so on.
> How to do it quickly?
>
> Thanks in advance.
> Sigit B. Wibowo
>
> ______________________________________________
> R-help@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.
>
--
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O
[[alternative HTML version deleted]]