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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Exporting file to sharepoint using R script editor

I have found a way to write to a file using R script editor in PowerBI. But the file directory is located on my hard drive. I'm trying to get it to write to a file that is located in Sharepoint. I'm not familiar with R coding, I used the code located in a tutorial.

require(gdata)
write.table(system(trim(dataset), file="(directory)", sep = "\t", row.names = FALSE))
plot(dataset);

Instead of '(directory)' I would include the URL which includes the directory to the folder in Sharepoint. However, it doesn't work.

I appreciate any help!

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

The last part of the code "upload-file C:/Users/Isra/Documents/pick.txt https://company.sharepoint.com/sites/wm/Folderdirectory.aspx"may be modified compares to the code in this thread.

 

As this issue is more related to R code, I would suggest you post here as I suggested before. 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous,

 

You can refer to this same thread: https://stackoverflow.com/questions/45948534/saving-files-to-sharepoint-folder-from-r

 

If you have further question about write R script, please post a thread here

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

So I used this code:

require(gdata)
system("curl --ntlm --user username:password--upload-file C:/Users/Isra/Documents/pick.txt https://company.sharepoint.com/sites/wm/Folderdirectory.aspx")
plot(dataset);

 And it ran because it plotted the dataset, however I can't see the file uploaded into the folder. Is there a mistake or a way I can see how the code ran?

Did you found the solution on how to automaticaly export an csv to a Sharepoint folder usin R script? 

Hi @Anonymous,

 

The last part of the code "upload-file C:/Users/Isra/Documents/pick.txt https://company.sharepoint.com/sites/wm/Folderdirectory.aspx"may be modified compares to the code in this thread.

 

As this issue is more related to R code, I would suggest you post here as I suggested before. 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

did it work for you , if so please do post the code that you have used . Even I have a requirement where I need to export PBI Data set to Share point folder using R

Hello could you please help me find a way to do the automatic CSV extraction to sharepoint?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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