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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

R Visuals not rendering in PBI Services

Hi Experts

 

I my R visuals are not displaying in pBI Services, these visual where fine until a few days ago (loading a working finre for a period of 9 months). I am not sure why they may have stopped displaying in PBI Services.

i have done the following steps.

1. Checked and Installed latest version of Cran R

2. Updated all the packages

3. have the most current version of desktop.

 

Not sure if i need to do anything on gateway???

 

The packages i am using in the R script in Desktop are

library(dplyr)
library(ggplot2)
library(survival)
library(survminer)
library(grid)
library(gridExtra)
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Team_eads

 

1. 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...). You could refer to this doucment:
https://docs.microsoft.com/en-us/power-bi/visuals/service-r-visuals#r-scripts-security

The r script is not access anything from a fodler path nor import.

 

2. R script code with functions you don't defined clearly or too complex to calculate(over 60s) also not works on service side. 

 

All the above has been working fine for the last 9 months, this should not stop working over night.

here is my R Script

library(dplyr)
library(ggplot2)
library(survival)
library(survminer)
library(grid)
library(gridExtra)
pc <- dataset
fstat <- pc %>% mutate(fstatus = case_when(OUTCOMETYPE=="Revised" ~ 1,TRUE ~ 0))
pmpa <- fstat %>% select(PRIMARYPROCEDUREID,PRIMARYTOOUTCOMEYEARS,fstatus,OUTCOMETYPE)
if(nrow(pmpa) < 4){
d <- pmpa %>% select(PRIMARYPROCEDUREID,PRIMARYTOOUTCOMEYEARS,OUTCOMETYPE) %>% mutate(INSUFFICIENTDATA = "Summary Results")
h = head(d[,2:4])
grid.table(h)
}else{
fit <- survfit(Surv(PRIMARYTOOUTCOMEYEARS,fstatus)~1,data = pmpa)
ggsurv <- ggsurvplot(fit,
ylab="Patient Analysis",
xlab="Time (Years)",
break.time.by = 1,
xlim = c(0,max(fit$time)),
surv.scale = "percent",
legend.title = "Kaplan-Meier",
legend.labs = "",
risk.table = FALSE,
fontsize = 3,
font.tickslab = c(10, "plain"),
risk.table.y.text = FALSE,
fun = "event"
)
ggsurv$plot <- ggsurv$plot + theme(plot.title = element_text(hjust = 0.5, size=18), panel.grid.major = element_line(colour = "grey90"))
ggsurv$table <- ggsurv$table + theme(plot.title = element_text(hjust = 0.5, size = 10))
ggsurv
}

 

View solution in original post

Anonymous
Not applicable

Hi All

The issues is a microsoft product problem. I have conformation Microsoft product team.

View solution in original post

7 REPLIES 7
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

1. 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...). You could refer to this doucment:
https://docs.microsoft.com/en-us/power-bi/visuals/service-r-visuals#r-scripts-security

2. R script code with functions you don't defined clearly or too complex to calculate(over 60s) also not works on service side. 

 

You can check through the above two points.

 

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

Hi Microsoft Team

 

I have uploaded the file to the Power BI Pro envirnment and it work fine the previous PBIX file was also working fine in the Premium, hence by conclusion there must be a bug in the Premium Environment setting.

We're noticing the same thing. Most of the (many) R visuals which render fine in the desktop files are not rendering in the service. 

Anonymous
Not applicable

Team_eads

 

1. 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...). You could refer to this doucment:
https://docs.microsoft.com/en-us/power-bi/visuals/service-r-visuals#r-scripts-security

The r script is not access anything from a fodler path nor import.

 

2. R script code with functions you don't defined clearly or too complex to calculate(over 60s) also not works on service side. 

 

All the above has been working fine for the last 9 months, this should not stop working over night.

here is my R Script

library(dplyr)
library(ggplot2)
library(survival)
library(survminer)
library(grid)
library(gridExtra)
pc <- dataset
fstat <- pc %>% mutate(fstatus = case_when(OUTCOMETYPE=="Revised" ~ 1,TRUE ~ 0))
pmpa <- fstat %>% select(PRIMARYPROCEDUREID,PRIMARYTOOUTCOMEYEARS,fstatus,OUTCOMETYPE)
if(nrow(pmpa) < 4){
d <- pmpa %>% select(PRIMARYPROCEDUREID,PRIMARYTOOUTCOMEYEARS,OUTCOMETYPE) %>% mutate(INSUFFICIENTDATA = "Summary Results")
h = head(d[,2:4])
grid.table(h)
}else{
fit <- survfit(Surv(PRIMARYTOOUTCOMEYEARS,fstatus)~1,data = pmpa)
ggsurv <- ggsurvplot(fit,
ylab="Patient Analysis",
xlab="Time (Years)",
break.time.by = 1,
xlim = c(0,max(fit$time)),
surv.scale = "percent",
legend.title = "Kaplan-Meier",
legend.labs = "",
risk.table = FALSE,
fontsize = 3,
font.tickslab = c(10, "plain"),
risk.table.y.text = FALSE,
fun = "event"
)
ggsurv$plot <- ggsurv$plot + theme(plot.title = element_text(hjust = 0.5, size=18), panel.grid.major = element_line(colour = "grey90"))
ggsurv$table <- ggsurv$table + theme(plot.title = element_text(hjust = 0.5, size = 10))
ggsurv
}

 

Anonymous
Not applicable

Hi All

The issues is a microsoft product problem. I have conformation Microsoft product team.
TomMartens
Super User
Super User

Hey,

 

here you will what R packages are supported on the service:

https://docs.microsoft.com/en-us/power-bi/service-r-packages-support

The current supported runtime is 3.4.4.

 

Maybe, updating your R environment has been responsible for the issue you are currently facing.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

hey tom

 

the issue was present even before i updated the R environment to 3.6.2 from 3.6.1. i have checked the Packages too and they are are supported for what i am trying to do. hence, why i am at a loss here.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors