cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
np212r
Regular Visitor

Rscript runs fine in Rstudio not in PowerBi

This script below runs fine in Rstudio but gives me ENVSXP error in PowerBi. Could anyone figure out why?

 

 

library(anomalize)

library(dplyr)

sub= tidyverse_cran_downloads %>%
  time_decompose(count) %>%
  anomalize(remainder)

 
4 REPLIES 4
CrisSalgado
Frequent Visitor

Hi, @np212r 

Could you solve this problem?

I'm using dplyr to

datafromAccess<-datafromAccess %>% #(lf)
        group_by(Slot, Period) %>% #(lf)
        mutate(colDiff= colValue - colValue[OrdemNum==1]

but results an error Error: Column `colDiff` must be length 1 (the group size), not 0

and many "warnings" : 

    Attaching package: 'dplyr'

            The following objects are masked from 'package:stats':

                    filter, lag

            The following objects are masked from 'package:base':

                    intersect, setdiff, setequal, union

The code works perfectly in R Studio, the dplyr version is 0.8.0.1 (that is supposed to be supported by PowerBI) and the package is installed in the same path of others (like RODBC and stringr) that works fine. 

Best Regards

Cristiane

v-huizhn-msft
Microsoft
Microsoft

Hi @np212r,

After research, there are the following thread and article for reference.

Getting Power BI Desktop to see R packages?
R Script error
Running Local R Scripts in Power BI

Best Regards,
Angelia

That did not work. Were you able to run the code I had put in my question?

Hi @np212r,

Did you configurate the R in Power BI desktop?

Best Regards,
Angelia

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Top Solution Authors
Top Kudoed Authors