0

I have specific need- one of the uploads I need to do is allowed only in .xls file.

So I am reading input in R (input is in .xlsx) via following command:

library(rio);
Data= import("Table.xlsx",skip=1); 

Now this Data is a dataframe in R. I want to save this in .xls format. However, package rio does not allow it via following command:

export((Data),"Table.xls"); #This command fails as rio does not support .xls

So question is- how do I store (export) my .xlsx file as .xls?

Any new library that can do this task?

Any new library or libraries are fine

zx8754
  • 52,746
  • 12
  • 114
  • 209
Chinmay123
  • 23
  • 4
  • 1
    The legacy .xls format is not well supported by R packages in general, or at least not obviously so, but just typing your query into google leads to the Writexls package. Try that. – Paul Stafford Allen Mar 20 '23 at 07:31
  • 4
    The xlsx R package (R interface to java software) and the WriteXLS R package (R interface to perl software) can write xls files. There are also non-R solutions. Libre Office has a command line utility soffice which can convert xlsx to xls. You can read an xlsx file into Excel and save it as xls. – G. Grothendieck Mar 20 '23 at 08:37
  • Paul and G. Grothendieck- Thanks for your help. WriteXLS package in R need java, so does this mean I need to execute the code outside RStudio? I am getting error in my mac using this package. Libre Office can be the easy solution to my problem though, thanks for the suggestion. – Chinmay123 Mar 23 '23 at 02:01

0 Answers0