Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Exporting with R to excel table

I have a report that all it does is export it's data to excel via power automate using some R code.

"write_xlsx(dataset,"file_path.xlsx")"

However, I need to manipulate it further and it needs to be in a tabular format to do so. Yet, when I try "write.table" I get the error that my connection to OneDrive is not open. So I can export an Excel sheet with the data, but not the same data as a Table.

Any ideas?

4 REPLIES 4
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Perhaps "write.table" doesn't support XLSX files. I didn't find examples that use "write.table" to export data to XLSX files. They export data to TXT, CSV or other formats. For XLSXs, they use "write_xlsx" or "write.xlsx". Maybe you can try "write.xlsx". 

 

Reference:

https://r-coder.com/export-data-r/ 

https://www.dataanalytics.org.uk/the-3-rs-writing/

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Anonymous
Not applicable

Thank you for replying. I've tried write_xlsx. The issue is writting it as a table. I can export it as a spreadsheet no problem. 

Hi @Anonymous 

 

I'm a little confused. When you want to write it as a table, which type of file are you writing it to? Can you show the current "write.table" code (removing sensitive info)?

 

Regards,

Jing

Anonymous
Not applicable

I can't write it as a table. I can export the data to excel as a .xlsx file, but it's not in table format.  But when I try

 

library("writexl")

 write.table(dataset,"C:\\file location.xlsx")

 

I am unable to do so. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors