cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Using R script in the query editor doesn't like row headers

Hi Power BI Community

 

We are using Power BI and want to also use R script in our queries.  We tried using the "Using R in Power Query Editor" example here  https://docs.microsoft.com/en-us/power-bi/desktop-r-in-query-editor  that contains a very simple csv file for the datasource and example r script to run. What we are finding is that when we follow the example through we get the error below. Trying to debug this we have found that if we change the header names in the file to "a", "b" and "c" then the R script supplied in the example works finew with the new single value no space column headers. Is there a reason why we are having issues with the headers in R script? We are running PowerBi version 2.68.5432.841 (April 2019) with R version 3.5.2. We also tried upgrading the r version on another machine (again debugging as we thought it might be a machine issue) to 3.6.0 and get the same error. 

 

Any help would be greatly appreciated. 

 

 

R script error

DataSource.Error: ADO.NET: R script error.
Loading required package: lattice

Attaching package: 'mice'

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

cbind, rbind

Error in parse(text = x, keep.source = FALSE) :
<text>:1:17: unexpected symbol
1: Day ~ 0+SMI+SMI missing
^
Calls: mice ... formula -> formula.character -> formula -> eval -> parse
Execution halted

Details:
DataSourceKind=R
DataSourcePath=R
Message=R script error.
Loading required package: lattice

Attaching package: 'mice'

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

cbind, rbind

Error in parse(text = x, keep.source = FALSE) :
<text>:1:17: unexpected symbol
1: Day ~ 0+SMI+SMI missing
^
Calls: mice ... formula -> formula.character -> formula -> eval -> parse
Execution halted

ErrorCode=-2147467259
ExceptionType=Microsoft.PowerBI.Scripting.R.Exceptions.RScriptRuntimeException

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Using R script in the query editor doesn't like row headers

@MarkTeviotdale ,

 

You may take a look at the post below.

https://community.powerbi.com/t5/Desktop/Using-R-in-Query-Editor/m-p/591505#M280652

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

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Using R script in the query editor doesn't like row headers

@MarkTeviotdale ,

 

You may take a look at the post below.

https://community.powerbi.com/t5/Desktop/Using-R-in-Query-Editor/m-p/591505#M280652

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

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 152 members 1,662 guests
Please welcome our newest community members: