Displaying 2 results from an estimated 2 matches for "fpattern".
Did you mean:
pattern
2012 Aug 17
4
Appending many different and separate Excel files using R
Dear all,
Good day!
I have a problem in reading Excel files in R and appending them to each other. Suppose we have several Excel files in a directory with headers and want to use R to append them in a single file with an additional variable in the final file indicating from which files the data come from.
As I have many Excel files and their sizes are very big I should write a loop in R to do
2012 Sep 18
0
Appending many different and separate Excel files using R
...r-project.org>
>> Date: Saturday, 18 August, 2012, 10:33 PM
>>
>>
>> Hello,
>>
>> Try the following.
>>
>>
>> # This needs several other packages
>> # install.packages("XLConnect")
>> require(XLConnect)
>>
>> fpattern <- "Book.*.xls?" # pattern for filenames
>> output.file <- "Test.xls"
>> lfiles <- list.files(pattern = fpattern)
>>
>> # Read first worksheet from each file
>> data.lst <-lapply(lfiles, readWorksheetFromFile, sheet = 1)
>>
>&g...