Kamlesh Khollam
2017-Nov-06 08:23 UTC
[R] Multiple CSV files in different sheets of an Excel file
Hi Team, I am tried "WriteXLS" package for merging 2 csv files. R script runs successfully but does not create CSVmerge file. Appreciate our help. ?Best Regards, Kamlesh Khollam? [[alternative HTML version deleted]]
Marc Schwartz
2017-Nov-06 14:47 UTC
[R] Multiple CSV files in different sheets of an Excel file
> On Nov 6, 2017, at 3:23 AM, Kamlesh Khollam <khollam.kamlesh33 at gmail.com> wrote: > > Hi Team, > I am tried "WriteXLS" package for merging 2 csv files. R script runs > successfully but does not create CSVmerge file. > > Appreciate our help. > > ?Best Regards, > Kamlesh Khollam?Hi, You appear to be replying to a thread from January of 2016, or almost two years ago, based upon the subject line. You have not provided any information (e.g. the code you used, sample data, any error messages, other relevant information) to allow us to help you. The WriteXLS package is designed to do one thing, export R data frames to Excel files. There is no data management functionality in the package, so if you want to "merge", "stack" or otherwise manipulate R data frames, you need to do that using code outside of the functions contained in the package. One of the posts from the thread in 2016 is: https://stat.ethz.ch/pipermail/r-help/2016-January/435342.html in which I provided sample code that would enable someone to read in two CSV files to an R list object, and then export those to two worksheets in an Excel file using the WriteXLS package, along with some hints on generalizing the approach to a larger number of CSV files. Perhaps you should review that, and if that is not what you want to do, post back with more detailed information. Regards, Marc Schwartz
Jeff Newmiller
2017-Nov-06 15:36 UTC
[R] Multiple CSV files in different sheets of an Excel file
You need to be more specific about what you mean by "merge" (read e.g. ?merge and ?rbind) and show what you did already using a reproducible example [1][2][3]. The fact that you mentioned sheets suggests you are writing to Excel files... they can be troublesome for storing data (NA values, size, unstructured layout, you can Google for more reasons) so unless you specifically have a requirement to interface with Excel you might consider CSV, zip, feather, or hdf5. If you have Java installed, the openxlsx package can be used to write a list of data frames in one statement. If you use lapply with read.csv to read the data in then this could be fairly compact, depending on what you mean by "merge". [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example [2] http://adv-r.had.co.nz/Reproducibility.html [3] https://cran.r-project.org/web/packages/reprex/index.html (read the vignette) -- Sent from my phone. Please excuse my brevity. On November 6, 2017 12:23:49 AM PST, Kamlesh Khollam <khollam.kamlesh33 at gmail.com> wrote:>Hi Team, >I am tried "WriteXLS" package for merging 2 csv files. R script runs >successfully but does not create CSVmerge file. > >Appreciate our help. > >?Best Regards, >Kamlesh Khollam? > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org 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.
Kamlesh Khollam
2017-Nov-07 07:50 UTC
[R] Multiple CSV files in different sheets of an Excel file
Hi Marc and Team, Apology for the late reply. I went through the github code for WriteXLS and accordingly passed required arguments. Its working fine now. I am able to create a excel workbook with multiple csv's. By Merge I mean create a excel workbook by adding multiple csv's as different sheets in it. Thank you again for your help and your time. On Mon, Nov 6, 2017 at 8:17 PM, Marc Schwartz <marc_schwartz at me.com> wrote:> > > > On Nov 6, 2017, at 3:23 AM, Kamlesh Khollam <khollam.kamlesh33 at gmail.com> > wrote: > > > > Hi Team, > > I am tried "WriteXLS" package for merging 2 csv files. R script runs > > successfully but does not create CSVmerge file. > > > > Appreciate our help. > > > > ?Best Regards, > > Kamlesh Khollam? > > Hi, > > You appear to be replying to a thread from January of 2016, or almost two > years ago, based upon the subject line. > > You have not provided any information (e.g. the code you used, sample > data, any error messages, other relevant information) to allow us to help > you. > > The WriteXLS package is designed to do one thing, export R data frames to > Excel files. > > There is no data management functionality in the package, so if you want > to "merge", "stack" or otherwise manipulate R data frames, you need to do > that using code outside of the functions contained in the package. > > One of the posts from the thread in 2016 is: > > https://stat.ethz.ch/pipermail/r-help/2016-January/435342.html > > in which I provided sample code that would enable someone to read in two > CSV files to an R list object, and then export those to two worksheets in > an Excel file using the WriteXLS package, along with some hints on > generalizing the approach to a larger number of CSV files. > > Perhaps you should review that, and if that is not what you want to do, > post back with more detailed information. > > Regards, > > Marc Schwartz > >-- Best Regards, Kamlesh Khollam Contact No: +91 7798424144 [[alternative HTML version deleted]]
Reasonably Related Threads
- Multiple CSV files in different sheets of an Excel file
- Export data to Multiple Sheets in Excel via xlsReadWritePro
- "easiest" way to write an R dataframe to excel?
- WriteXLS: 'object not found' error within function
- export tables to excel files on multiple sheets with titles for each table