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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Tina_CSS
Regular Visitor

R Visual not working in PBI services

Hi everyone,


I created R visual in desktop (as a custom visual!), it works perfectly and once I've tried to publish it to services it gives me this error below...I have no idea what to do, I've tried everything. Seems very like half job done from Microsoft Power BI team, that you work on some R visual for 2 days and then you can't put it online, I mean what's the point???

Script Runtime Error

Loading required package: XML

Loading required package: htmlwidgets

Please upgrade the 'shiny' package to (at least) version 1.1

Loading required package: ggplot2

Loading required package: plotly

 

Attaching package: 'plotly'

 

The following object is masked from 'package:ggplot2':

 

last_plot

 

The following object is masked from 'package:stats':

 

filter

 

The following object is masked from 'package:graphics':

 

layout

 

Error in shell.exec(url) :

access to 'C:\Users\Client\Temp\RtmpKYXLAD\viewhtml1c7e1d3719/index.html' denied


Please try again later or contact support. If you contact support, please provide these details.
Activity ID: 80e43511-826d-480f-a347-de12d780a834
Request ID: 98da7e8a-0832-1117-b74f-a357432d9a95
Correlation ID: c2d5a130-4b2d-58c0-ce8b-8cc63a39774c
Time: Mon Sep 02 2019 09:55:48 GMT+0200 (stredoeurópsky letný čas)
Version: 13.0.10599.151
Cluster URI: https://wabi-europe-north-b-redirect.analysis.windows.net

 

This is my code:

 

source('./r_files/flatten_HTML.r')

############### Library Declarations ###############
libraryRequireInstall("ggplot2");
libraryRequireInstall("plotly");
####################################################

################### Actual code ####################

 

library(plotly, warn.conflicts=FALSE)
library(graphics, warn.conflicts=FALSE)
library (stats, warn.conflicts=FALSE)
library(ggplot2, warn.conflicts=FALSE)

df <- Values

a <- as.numeric(Values$NET_VALUE_IN_EURO)
b <- as.numeric(Values$NET_VALUE_IN_EURO)
Euro <- "\u20AC"
b[b>1e6] <- paste(format(round(b[b>1e6]/ 1e6, 1), trim = TRUE), "M ")
c <-with(df, paste(Values$State_Name,b,Euro))
a <-log(a)

#Set country boundaries as light grey
l <- list(color = toRGB("#ffffff"), width = 0.5)
#Specify map projection and options
g <- list(
showframe = TRUE,
framecolor='#e6e6e6',
showcoastlines = FALSE,
projection = list(type = 'orthographic'),
resolution = '100',
showcountries = TRUE,
countrycolor = '#003563',
showocean = FALSE,
showlakes = TRUE,
lakecolor = '#99c0db',
showrivers = TRUE,
rivercolor = '#99c0db'
)

p <- plot_geo(df) %>%
add_trace(z= ~Values$NET_VALUE_IN_EURO, colors = 'Blues',
text=~c, locations = ~Values$State_Code, marker = list(line = l)) %>%
colorbar(title = 'BLA') %>%
layout(title = '', geo = g)
print(p)
info()
skip()
p=ggplotly(p);
internalSaveWidget(p, 'out.html');

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @Tina_CSS ,

I'd like to suggest you to take a look at below document about use r script in power bi service:

Creating R visuals in the Power BI service#r-scripts-security

 

Spoiler

R visuals are created from R scripts, which could potentially contain code with security or privacy risks.

These risks mainly exist in the authoring phase when the script author run the script on their own computer.

The Power BI service applies a sandbox technology to protect users and the service from security risks.

This sandbox approach imposes some restrictions on the R scripts running in the Power BI service, such as accessing the Internet, or accessing to other resources that are not required to create the R visual.

For security reasons, some of r script functions has been blocked on power bi service side.(e.g. access external datasource, write/access to specific folder path, import/export file...) 

BTW, r script code with functions you not defined clearly or too complex to calculate(execute over 60s) also not works on service side.(such as, functions with undefined option parameters, undefined clearly data type, complex looping calculation...)
Notice: you can also check following link to confirm your packages are available on power bi service side:

R packages in the Power BI service

 

Regards,

Xiaoxin Sheng

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

View solution in original post

5 REPLIES 5
michaelgraves_9
New Member

Yup I'm getting the same error message, agree with the above comments, if it works on desktop it should work on service 

gomezepor
New Member

I experienced same issue. 

Does any one know the solution?

 

Thank you

v-shex-msft
Community Support
Community Support

Hi @Tina_CSS ,

I'd like to suggest you to take a look at below document about use r script in power bi service:

Creating R visuals in the Power BI service#r-scripts-security

 

Spoiler

R visuals are created from R scripts, which could potentially contain code with security or privacy risks.

These risks mainly exist in the authoring phase when the script author run the script on their own computer.

The Power BI service applies a sandbox technology to protect users and the service from security risks.

This sandbox approach imposes some restrictions on the R scripts running in the Power BI service, such as accessing the Internet, or accessing to other resources that are not required to create the R visual.

For security reasons, some of r script functions has been blocked on power bi service side.(e.g. access external datasource, write/access to specific folder path, import/export file...) 

BTW, r script code with functions you not defined clearly or too complex to calculate(execute over 60s) also not works on service side.(such as, functions with undefined option parameters, undefined clearly data type, complex looping calculation...)
Notice: you can also check following link to confirm your packages are available on power bi service side:

R packages in the Power BI service

 

Regards,

Xiaoxin Sheng

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

Hello!

All the packages I used in my report are listed as supported on the link mentionned above.

My report still don't work on the service. 😞

 

Regards!

 

ID d'activité: 5147c214-cb2a-43ca-853f-2f181843870e
ID de demande: bcfed760-aff4-1528-c249-d5232575303e
ID de corrélation: 113cfc3b-f8d7-e0d8-a7ff-683a9cadb5ed
Heure: Thu Jun 02 2022 14:57:56 GMT-0400 (heure avancée de l’Est)
Version du service: 13.0.18400.37
Version du client: 2205.5.11559-train
URI du cluster: https://wabi-canada-central-redirect.analysis.windows.net/

 

Does any one know the solution?

 

Thank you

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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