Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago

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_Deckler's avatar
    Greg_Deckler
    Community Champion

    Any chance you can share some sample data and your R script so that we can try to replicate?

    • Anonymous's avatar
      Anonymous
      Not applicable
      Hi 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
      • Anonymous's avatar
        Anonymous
        Not 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_input

         

        ADDITIONAL INFO

        Tried the same script as data source and it works perfectly! Just not as a Transform step within the query :(

  • ankitpatira's avatar
    ankitpatira
    Community 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.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Did you ever find a solution? Having same issue...

    • Anonymous's avatar
      Anonymous
      Not 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.