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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
venkik79
Frequent Visitor

R custom visual - Error only in PowerBI Service ( works fine in powerbi Desktop and R studio)

I have the below script where i am plotting a HEATMAP using heatmaply function. This works with no issues in PowerBI desktop and R studio. When i publish it to powerbi service - i get the below SCRIPT RUN TIME error.

 

Error in eval(substitute(expr), data, enclos = parent.frame()) : object 'tickvals' not found

 

############### Library Declarations ###############
#libraryRequireInstall("ggplot2");
libraryRequireInstall("plotly")
libraryRequireInstall("heatmaply")
#libraryRequireInstall("tidyverse")
libraryRequireInstall("tidyr")
####################################################

################### Actual code ####################
#g = qplot(`Petal.Length`, data = iris, fill = `Species`, main = Sys.time());
pal1<-c("0"="gray","1"="orange","2"="yellow","3"="green","4"="blue")
#cm<-as.matrix(Values)
d1<-pivot_wider(Values,names_from = ProcessName,values_from=Level1)
d2<-as.data.frame(d1)
rnames<-d2[,1]
d3<-d2[,-1]
d3[is.na(d3)] <- 0
rownames(d3)=rnames
p = heatmaply(d3,dendrogram = FALSE,colors =pal1,grid_gap = 0.5,hide_colorbar = TRUE,fontsize_row = 6,fontsize_col=6);
####################################################

############# Create and save widget ###############
#p = ggplotly(p);
internalSaveWidget(p'out.html');
####################################################
2 REPLIES 2
Anonymous
Not applicable

Hi @venkik79 

Please check if your R package is supported in power bi Service.

For more info you may refer to this blog: Create visuals by using R packages in the Power BI service

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

venkik79
Frequent Visitor

Appreciate your reply

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.