cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
laurentWeave Frequent Visitor
Frequent Visitor

R script only work localy

I have a R script embeded in a page that worked perfectly localy in my Power BI Desktop application but is not working when I publish on Power BI.

 

 

library(dplyr)
library(ggplot2)
library(lubridate) # for working with dates
#evolution du CA dans le temps


dataset$date_gagne <- strtrim(dataset$date_gagne,c(10))


dt2 <- dataset %>% filter (!is.na(ca_entite)) %>%
  mutate(date = ymd(date_gagne)) %>%
  arrange(date_gagne) %>%
  mutate(cumsum = cumsum(ca_entite))

dt2 %>% ggplot(aes(date, cumsum)) + geom_line(colour = "red",size = 3) +
  xlab("") + ylab("CA BT") + theme_linedraw(base_size = 11, base_family = "") +
  labs(title = "Evolution du CA dans le temps") 

 

The error message is :

 

 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
 Error in mutate_impl(.data, dots) : 
 (converted from warning) unable to identify current timezone 'C':
 please set environment variable 'TZ'
 In addition: Warning messages:
  1: package 'dplyr' was built under R version 3.2.5 
  2: package 'ggplot2' was built under R version 3.2.5 
  3: package 'lubridate' was built under R version 3.2.4 

 

6 REPLIES 6
laurentWeave Frequent Visitor
Frequent Visitor

script R only works in Power BI Desktop

I have a R script that works localy but is not working when I publish it on power BI

 

library(dplyr)
library(ggplot2)
library(lubridate) # for working with dates
#evolution du CA dans le temps


dataset$date_gagne <- strtrim(dataset$date_gagne,c(10))


dt2 <- dataset %>% filter (!is.na(ca_entite)) %>%
  mutate(date = ymd(date_gagne)) %>%
  arrange(date_gagne) %>%
  mutate(cumsum = cumsum(ca_entite))

dt2 %>% ggplot(aes(date, cumsum)) + geom_line(colour = "red",size = 3) +
  xlab("") + ylab("CA BT") + theme_linedraw(base_size = 11, base_family = "") +
  labs(title = "Evolution du CA dans le temps > prod BT", subtitle = "CA BT") 

 

The error I got is the following:

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
 Error in mutate_impl(.data, dots) : 
 (converted from warning) unable to identify current timezone 'C':
 please set environment variable 'TZ'

 In addition: Warning messages:
 
 1: package 'dplyr' was built under R version 3.2.5 
 2: package 'ggplot2' was built under R version 3.2.5 
 3: package 'lubridate' was built under R version 3.2.4 
 
 
Moderator v-viig
Moderator

Re: R script only work localy

Hello @laurentWeave

 

Thank you for reaching us.

We'll involve our R-script developer to assist you.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

v-jiascu-msft Super Contributor
Super Contributor

Re: script R only works in Power BI Desktop

Hi @laurentWeave,

 

I have consulted the Product Team. I will post the result here later.

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft Super Contributor
Super Contributor

Re: script R only works in Power BI Desktop

Hi,

 

I have reported this issue: CRI 52371475. Any news I will post here. 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
peterglobal Frequent Visitor
Frequent Visitor

Re: script R only works in Power BI Desktop

Hi,

 

I'm having the same issue with GGPLOT2 in the service.

Why is that R script is running 3.2.2 and is not patched to a newer version that supports newer R packages in the service?

 

Thanks

Highlighted
simek Occasional Visitor
Occasional Visitor

Re: R script only work localy

I have a similar problem with my R script working locally but not in the shared workspace. Other ggplot2 graphs without dplyr are working so I assume that it is dplyr causing the problem. However, this error makes having R scripting in Power BI nigh on pointless because for me it's particular value is being able to easily manipulate the data.

 

I can't post my code or the error because the website keeps throwing errors when I try.

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 253 members 3,140 guests
Please welcome our newest community members: