Forum Discussion
R error
The following error appears when running R script in powerbi but not in RStudio, please help.
My R version is 3.3.1
DataSource.Error: ADO.NET: R script error.
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 check_input(x) :
Input must be a character vector of any length or a list of character
vectors, each of which has a length of 1.
Calls: %>% ... unnest_tokens -> unnest_tokens_ -> tokenfunc -> tf -> check_input
Execution halted
Details:
DataSourceKind=R
DataSourcePath=R
Message=R script error.
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 check_input(x) :
Input must be a character vector of any length or a list of character
vectors, each of which has a length of 1.
Calls: %>% ... unnest_tokens -> unnest_tokens_ -> tokenfunc -> tf -> check_input
Execution halted
ErrorCode=-2147467259
ExceptionType=Microsoft.PowerBI.Radio.RScriptRuntimeException
8 Replies
- Greg_DecklerCommunity Champion
Any chance you can share some sample data and your R script so that we can try to replicate?
- AnonymousNot applicableHi there
Yep the data was a tweet dataset.
And yep I have the packages installed and loaded in r script
I copied and pasted the script in rstudio and it worked fine.
I got a feeling like it's tidytext package clashes with split. I'm no expert in R.
Thank you so much- AnonymousNot applicable
I think the problem is this bit below Im not sure why tho.
Error in check_input(x) :
Input must be a character vector of any length or a list of character
vectors, each of which has a length of 1.
Calls: %>% ... unnest_tokens -> unnest_tokens_ -> tokenfunc -> tf -> check_inputADDITIONAL INFO
Tried the same script as data source and it works perfectly! Just not as a Transform step within the query :(
- ankitpatiraCommunity Champion
Anonymous Have you got the package you're using in your script intalled. If the package is installed then you need to load that package in your script ie use library(packagename) at start of the script.
- AnonymousNot applicable
Did you ever find a solution? Having same issue...
- AnonymousNot applicable
yeah - for some reason, PowerBi takes character column as factor rather than character so I need to cast the column to as.character(dataset$column1) then it worked.
You may need to transform the column and apply Clean so it gets rid of whitespace etc...
Let me know if that works for you.