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
dpombal
Post Partisan
Post Partisan

R Visual Rcpp package error

Hi, all

I was using several custom visuals using R using R 3.4.2 however after upgrading to latest R 3.5.1 I find both custom  R visuals and basic Object visuals using R start failing (even after upgrading packages to R 3.5.1 compatibility)

 

 

1st Error on R Visual

 

R Code

library(ggplot2)
t<-ggplot(dataset, aes(ID, Promedio)) + geom_point(aes(color=factor(Year))) + facet_wrap(~Year)
#Cambiando los colores
t + scale_color_manual(values=c("red","black","green"))

 

 

Error trace 1

 

Error Message: Error in R script .
Error: package or namespace load failed for 'ggplot2':
 package 'Rcpp' was installed by an R version with different internals; it needs to be reinstalled for use with this R version
Ejecución interrumpida

 

 

Most annoying part is that previous code works in RStudio!! I have Powerbi--Z Options-->R pointing to my R version 3.5.1

 

 

 

 

 

RCPP1.PNG

 

 

 

 

Same code in R Studio works OK, without errors

RCPP2.PNGsRCPP3.PNG

 

ñ

RCPP.PNG

 

 

g

2º nd Error on Forecasting ARIMA R Visual

Error Trace

 

Error Message:
Error del script R.
Loading required package: XML
Loading required package: htmlwidgets
Error: package or namespace load failed for 'htmlwidgets':
 package 'Rcpp' was installed by an R version with different internals; it needs to be reinstalled for use with this R version
Warning message:
In libraryRequireInstall("htmlwidgets") :
  *** The package: 'htmlwidgets' was not installed ***
Loading required package: scales
Error: package or namespace load failed for 'scales':
 package 'Rcpp' was installed by an R version with different internals; it needs to be reinstalled for use with this R version
Warning message:
In libraryRequireInstall("scales") :
  *** The package: 'scales' was not installed ***
Loading required package: forecast
Error: package or namespace load failed for 'forecast':
 package 'Rcpp' was installed by an R version with different internals; it needs to be reinstalled for use with this R version

2 ACCEPTED SOLUTIONS

I had yesterday the same problem. Only reinstalling (or even go back to older versions) did not help.

Only after I deleted the libraries in "<user>/documents/R" and in "<user>/library"  and reinstalled R and installed the packages I needed, the problem was solved.

 

I think mixed package versions in <user>/library did give the problem for me. I did not know that packages were also in that directory. Only uninstall R en delete "<user>/documents/R" was not enough.

The newest version of PowerBi and R (3.5.1) are now working for me.

View solution in original post

my problem....old versions installed here "<user>/library"  ...and newer ones  "<user>/documents/R". Deleting  "<user>/library" work!! **bleep**ing libraries...only 6 where the problem...I updated libraries several times... "<user>/documents/R"

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

Hi @dpombal,

 

According to your error message, it normally appears when loading failed for some R packages.
In my opinion, I'd like to suggest you copy these package name and reinstall in R studio.(please confirm install success and update all packages to last version)

 

Regards,

Xiaoxin Sheng

I reinstall libraries and keeps on failing could anyone test this on new R 3.5.1 and check if Rcpp is compatible?

I had yesterday the same problem. Only reinstalling (or even go back to older versions) did not help.

Only after I deleted the libraries in "<user>/documents/R" and in "<user>/library"  and reinstalled R and installed the packages I needed, the problem was solved.

 

I think mixed package versions in <user>/library did give the problem for me. I did not know that packages were also in that directory. Only uninstall R en delete "<user>/documents/R" was not enough.

The newest version of PowerBi and R (3.5.1) are now working for me.

Clare
Microsoft Employee
Microsoft Employee

Thank you. Your solution worked after I also uninstalled RTools from C:\Rtools and reinstalled.

Great Man, cvhaven!

 

A Very Big Human Gratitude for this hint to you!

 

I lost a full manday due to updating PowerBI Desktop yesterday. It then required me to update R from 3.5.0 to 3.5.1, then R packages, then to solve emerged issues with R charts, but still not being able to get my dashboard to work...

It came at the worst possible time without any possibility to roll back. I was absolutely desperate until I saw your post. Your solution worked.

 

As a result of this incident I believe PowerBI should change their Desktop update policy from replacing an earlier version to keeping both versions until the user is able to fully test it.  (i.e. implementing a TEST + PROD environment)

 

Final note: the same dashboard published in PowerBI Service was not affected at all. Does it imply that PowerBI Service still uses R 3.5.0, and therefore issues there are yet to be expected?

my problem....old versions installed here "<user>/library"  ...and newer ones  "<user>/documents/R". Deleting  "<user>/library" work!! **bleep**ing libraries...only 6 where the problem...I updated libraries several times... "<user>/documents/R"

Anonymous
Not applicable

HI @dpombal,

 

Actually, you need to refer to error message to add libraries to R script until finish add all requests libraries and packs.(I fix one similar missing package issues by this method)

 

Regards,

Xiaoxin Sheng

I am not understanding you, how can I fix this...if all libraries are installed an in Rstudio works ok...

 

thanks in advance

Rcpp also fails with PBIVIZ custom visuals...like timeseries forecasting, and charts i cannot modify

Anonymous
Not applicable

HI @dpombal,

 

I mean you can install bold part package (display in error message) on r studio side to fix failed loading issue.(install until no similar error message appears)

Error: package or namespace load failed for 'xxxxxx':

 

In addition, custom visual failed means request packages failed to load(missing or not compatibility).

 

Regards,

Xiaoxin Sheng

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.