An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121213/c71ed20c/attachment.pl>
How to create multiple country's data into multiple sheets of one excel
3 messages · Tammy Ma, Anthony Damico, jim holtman
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121213/708275c3/attachment.pl>
I use the XLConnect package to write out multiple sheets to an Excel workbook
On Thu, Dec 13, 2012 at 7:52 AM, Tammy Ma <metal_licaling at live.com> wrote:
HI,
I have large dataset of many countries. I have written the program to run through each country to generate one output for each country. I want to put the output like this:
one sheet has output for one country. How do I achieve it by r.
I have tried this:
library(xlsx)
write.xlsx(nnn, "vn.xlsx", sheetName="Sheet1") [1]
but when I change sheetName="Sheet2" to add up another country into one sheet. it autimatically deleted which I have down on [1].
index<-unique(dataset$country)
for (i in 1:length(index)){
data<-dataset[dataset$country==index[i],]
(...)
output<-dd
#then how do I create each country's output into one sheet of one excel???
}
Kind regards,
Tammy
[[alternative HTML version deleted]]
______________________________________________ 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.
Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it.