Re: Multiple CSV files in different sheets of an Excel file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Multiple CSV files in different sheets of an Excel file

Kamlesh Khollam
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]]

______________________________________________
[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: Multiple CSV files in different sheets of an Excel file

Marc Schwartz-3


> On Nov 6, 2017, at 3:23 AM, Kamlesh Khollam <[hidden email]> 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

______________________________________________
[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: Multiple CSV files in different sheets of an Excel file

Jeff Newmiller
In reply to this post by Kamlesh Khollam
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 <[hidden email]> 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]]
>
>______________________________________________
>[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.

______________________________________________
[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: Multiple CSV files in different sheets of an Excel file

Kamlesh Khollam
In reply to this post by Marc Schwartz-3
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 <[hidden email]> wrote:

>
>
> > On Nov 6, 2017, at 3:23 AM, Kamlesh Khollam <[hidden email]>
> 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]]

______________________________________________
[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.