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.
############### 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');
####################################################