I ran into this issue displaying an R visual in Power BI desktop. The script works fine in RStudio, and also on powerbi.com
The error I get is:
Error Message: R script error. Error: package or namespace load failed for 'ggplot2': package 'scales' was installed by an R version with different internals; it needs to be reinstalled for use with this R version
This is what the script looks like. It's a simple test of showing an R visual in Power BI.
I created a report with a R visual, with this script:
library(ggplot2) ggplot(dataset, aes( x =dataset$lotsize, y=dataset$price)) + geom_point(shape=1) + geom_smooth()
The ggplot2 package is installed in the R home\library folder. So is the scales package.