file creating

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

file creating

Partha Sinha
I am using R(3.4.3), Win 7(extreme edition) 32 bit,
I have 10 excel files data1,xls, data2.xls .. till data10.xls.
I want to create 10 dataframes . How to do ?
regards
Parth

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: file creating

Ulrik Stervbo-2
You could loop over the file names, read each excel file and store the
individual data frames in a list using lapply.

I prefer to read excel files with the package readxl.

The code could be along the lines of

library(readxl)
my_files <- c("file1", "file2")

lapply(my_files, read_excel)

HTH
Ulrik

Partha Sinha <[hidden email]> schrieb am Mo., 11. Dez. 2017, 08:13:

> I am using R(3.4.3), Win 7(extreme edition) 32 bit,
> I have 10 excel files data1,xls, data2.xls .. till data10.xls.
> I want to create 10 dataframes . How to do ?
> regards
> Parth
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.