Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

0

Trouble with Linear Regression

Dear fellows, I am having trouble with a script of R in Power BI. I reproduce here the code:

 

# 'dataset' tem os dados de entrada para este script

library("dplyr")
library("broom")

cdds_reg2 <- dataset %>% group_by(MCU) %>% do(fit_cdds2 = lm(log(CARGA_TRABALHO) ~ log(Custos) + log(EFETIVO_PROD_HORA) + log(ADMINISTRATIVO_HORA), .))

fit_cdds_df2 <- cdds_reg2 %>% tidy(fit_cdds2)

output <- fit_cdds_df2

 

After that, I got the following error: DataFormat.Error: SYMSXP (inside the nice yellow thing).

 

I would like if this could be a problem with the packages that I'm using or, whatelse.

 

Thanks in advance

Status: Delivered
Comments
v-haibl-msft
Employee

@Jose_Adeilson

 

Could you please share your PBIX file to me so that I can have a test on my side?

 

Best Regards,
Herbert

Vicky_Song
Impactful Individual
Status changed to: Needs Info
 
Jose_Adeilson
Regular Visitor

Dear Herbert,

 

This is the link to the PBIX in my google drive:

 

https://drive.google.com/open?id=0B6-iEUO9QjYBejM4d24ydVp0dDQ

 

By the way, I cannot share the original one. So, I made a test with the Wooldrige datasets.

 

Let me know if you have trouble to get the file.

 

jose.adeilson@gmail.com

 

Best regards

José Silva

 

 

 

v-haibl-msft
Employee

@Jose_Adeilson

 

Can you run this script successfully with results in RStudio?

 

Best Regards,
Herbert

Jose_Adeilson
Regular Visitor

Dear Herbert,

 

Yes, I can run the script at RStudio. No problem there.

 

Best Regards

Jose_Adeilson
Regular Visitor

@v-haibl-msft

 

Dear Herbert,

 

Yes, I can run the script at RStudio. No problem there.

 

Best Regards

v-haibl-msft
Employee

@Jose_Adeilson

 

I can repro the same issue as you. I’ve reported it internally to Power BI Team: CRI 38310085
I’ll post here once I get any update about it.

 

Best Regards,
Herbert

Vicky_Song
Impactful Individual
Status changed to: Accepted
 
v-haibl-msft
Employee

@Jose_Adeilson

 

I've got response from the Product Team.

 

The issue could happen due to R workspace ending up dirty with artifacts not supported by PBID parsers.

The simple fix for that would be cleaning up workspace at the end, leaving only the output data frame.

Adding this line at the end should solve the issue:

rm(list=setdiff(ls(), "FinalDataset")).

 

Best Regards,
Herbert

Jose_Adeilson
Regular Visitor

@v-haibl-msft

 

Hi Herdert,

 

The code worked fine. Thanks