cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Export table to csv using r script adds extra column

Hi

 

I have a simple r script (below) which is exporting a table into csv and saving in a local area. This all works fine, however when the file exports, it adds a blank column at the beginning with the row number for each record. Does anyone know how to stop this from happening?

 

write.csv(dataset, file = "G:/xxx/xxx.csv")

 

Any help greatly appreciated

1 ACCEPTED SOLUTION
mahoneypat
Microsoft
Microsoft

Update your R script as follows:

 

write.csv(dataset, file = "G:/xxx/xxx.csv", row.names = FALSE)

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Perfect, thank you

mahoneypat
Microsoft
Microsoft

Update your R script as follows:

 

write.csv(dataset, file = "G:/xxx/xxx.csv", row.names = FALSE)

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors