cancel
Showing results for 
Search instead for 
Did you mean: 
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

3 REPLIES 3
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.

View solution in original post

Does any one know the solution?

 

Thank you

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors