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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

R Script Visual error - Can't find R

Hi all,

I am unable to use the R Script visual in Power BI desktop, getting the 'Failed to retrieve error code string from System -> 317'. This seems to indicate PBI cannot find R, even though it is connected to the correct folder. 

 

As PBI does not support newer versions of R, this version has been extracted to a local folder (...\Documents\R-3.4.4) without administrative privalleges. R Studio can connect to it and run without problem. Running the PBI visual in R Studio (clicking the arrow icon) works without problem. Only base R functions are used.

Just wondering if there are any path or environment variables to be aware of? A newer version has been installed with admin privalleges to Program Files. Could that installation be interefering with how Power BI connects to R? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @v-shex-msft, thanks for replying. It was a good idea to move the folder around the computer, as the Documents folder was linked to OneDrive. After relocating R to C:\R\R-3.3.3 (also trying an older version), a new error presented, claiming permission was denied.

This might have become a similar problem to this, where antivirus software was preventing Power BI from accessing R. 


Edit, confirmed. After checking event logs in antivirus software, Rscript.exe was prevented from accessing the RScriptWrapper.R file as executing scripts are blocked in this organisation. 

Edit2: It actually works when published online!, including the usage of a version of ggplot2 incompatible with R~3.4.4. So clearly there's a difference in how R Script visuals process bewtween Power BI Desktop and Power BI service.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

Where are you storing the r script related to packages? Did these saved locally or hosted on the remote/shared server? Have you checked the current account and power bi client has enough permission to access and edit the specific folder/files with these contents?

Please share some more detailed information to help us clarify these:

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Hi @v-shex-msft, thanks for replying. It was a good idea to move the folder around the computer, as the Documents folder was linked to OneDrive. After relocating R to C:\R\R-3.3.3 (also trying an older version), a new error presented, claiming permission was denied.

This might have become a similar problem to this, where antivirus software was preventing Power BI from accessing R. 


Edit, confirmed. After checking event logs in antivirus software, Rscript.exe was prevented from accessing the RScriptWrapper.R file as executing scripts are blocked in this organisation. 

Edit2: It actually works when published online!, including the usage of a version of ggplot2 incompatible with R~3.4.4. So clearly there's a difference in how R Script visuals process bewtween Power BI Desktop and Power BI service.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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