Forum Discussion

J_4923's avatar
J_4923
Frequent Visitor
9 years ago

Exporting data using R

Hi,
I’m trying to export data from Power BI using R. I’ve tried to follow http://www.thebiccountant.com/2015/12/28/how-to-export-data-from-power-bi-and-power-query/

However I’m getting an error message:

 

 


 
The steps that I’ve used:
1. Create new report (page1)
2. Choosing two columns (BLNumber, ChrgWeight) from table (PS_total)
 
3. Applying R script visual


 
4. Getting the R script editor


 
5. Pasting this code: write.table(trim(dataset), file=”Libraries/Documents/R-test.txt”, sep = “\t”, row.names = FALSE);


6. When pressing the Run script, I’m getting the Error message and file R-test.txt is still blank

 

Can anyone please help me?
Thanks

4 Replies

  • v-sihou-msft's avatar
    v-sihou-msft
    Microsoft Employee

    J_4923

     

    As I tested, you need to grant the permisson for "ALL APPLICATION PACKAGES" and "ALL RESTRICTED APPLICATION PACKAGES" on that text file security.

     

     

    Then that R script should work.

     

    require(gdata)
    write.table(trim(dataset), file="/Program Files/R/R-3.3.3/1.txt", sep = "\t", row.names = FALSE)
    plot(dataset);

     

     

     

     

     

    Regards,