Question: Write excel file formatted as Table in R
0
gravatar for erfan741
2.7 years ago by
erfan74150
London, ON, Canada
erfan74150 wrote:

In Excel, by selecting all the sheet and clicking on "Format as Table" one can change the format of the sheet to table which allows interactive filtering of the columns. How do I generate an excel file using R, with the same formatting? I am using XLSX package in R, but apparently it doesnt have this feature.

excel R table • 1.6k views
ADD COMMENTlink modified 2.7 years ago by Antonio R. Franco4.2k • written 2.7 years ago by erfan74150

Is your data already in a data frame? Have you tried write.csv()? Excel has no problem reading .csv files. Come to think of it, excel can read txt outputs from write.table(...,sep='\t') as well.

ADD REPLYlink written 2.7 years ago by Jake Warner780
1

I think the OP wants to output a .xlsx file which can have markup applied to in R, such that when it's read in to Excel, it is pre-formatted as a table (not just a spreadsheet). As for an answer, if XLSX doesn't have that functionality, you could check out some of the other packages listed here: https://www.r-bloggers.com/r-the-excel-connection/ I don't know categorically whether they do or not though, I've never tried it myself.

ADD REPLYlink written 2.7 years ago by Joe15k

Yes This is what I want, But I can't find a way of doing that. It s strange that these packages don't have this simple functionality.

ADD REPLYlink written 2.7 years ago by erfan74150
1
gravatar for Antonio R. Franco
2.7 years ago by
Spain. Universidad de Córdoba
Antonio R. Franco4.2k wrote:

I use to export the data using the comma "," as a delimitator, and this creates a csv file that Excel can open without problems Can this be an answer to your question ?

ADD COMMENTlink written 2.7 years ago by Antonio R. Franco4.2k

No this is not the answer. I want my output as an excel file marked-up as Table inside EXCEL.

ADD REPLYlink written 2.7 years ago by erfan74150
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1135 users visited in the last hour