cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

R script error when exporting data

I have an R script that aims to export the data of a report to excel already handling the export problems (special characters, formatting errors among others).

 

Below is the script and error, I already installed several packages in my R studio but the error persists.

 

# Write.csv (dataset.file = "PowerBIExport.csv")
"Write.table (trim (dataset), file =" C: /Users/vitor.oliveira/Desktop/teste.txt ", sep =" \ t ", row.names = FALSE)

 

Error Message:
R. Script Error
Error in is.data.frame (x): could not find the function "trim"
Calls: write.table -> is.data.frame
Execution stopped

20 REPLIES 20

@Steve_Wheeler 

I am trying to export data from power bi to csv file using R

I am giving the below commandin Power Query

write.csv(ALL_Data, "C:\\Users\\username\\Documents\\folder 1\\folder 2\\folder 3\\folder 4\\filename.csv")

I am getting the below error please help

DataSource.Error: ADO.NET: R script error.
Error in is.data.frame(x) : object 'ALL_Data' not found
Calls: write.csv ... eval.parent -> eval -> eval -> write.table -> is.data.frame
Execution halted

Details:
    DataSourceKind=R
    DataSourcePath=R
    Message=R script error.
Error in is.data.frame(x) : object 'ALL_Data' not found
Calls: write.csv ... eval.parent -> eval -> eval -> write.table -> is.data.frame

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors