sentimentr_qvr <- read.csv("C:/data/CES.csv")
average_sent_score <- sentiment_by(sentimentr_qvr_sentence, by = NULL)
Above code runs fine in R studio but its throwing error when i run through PowerBI. your help is very much appreciated!
Check to see if that library/package is supported by PowerBI at this time. See this link for documentation:
Hi @dedelman_clng ,
I am also trying to use "sentimentr" library in My powerBI dataset. But having the same "DataFormat.Error: ENVSXP" for the same script. My code also works fine in RStudio. I am very new to PowerBI. I really appreciate any suggestion regarding this.
# 'dataset' holds the input data for this script #dataset has only one 'Text' column library(dplyr) library(sentimentr) df_final_tweets <- data.frame ( Tweet_Text = c(dataset$Text), stringsAsFactors = FALSE ) senti_text <- get_sentences(df_final_tweets) Sentiment = sentiment_by(senti_text,by = NULL) dataset_with_Sentiment_score <- data.frame ( Tweet_TEXT = c(df_final_tweets$Tweet_Text), Senti_Score = round(Sentiment$ave_sentiment , 2 ), stringsAsFactors = FALSE )
Note: According to the Most Recent PowerBI Documentation "sentimentr" package is supported by PowerBI at this time.
Thanks in advance.
Hi @dedelman_clng ,
Thanks for replying. I am using the latest(September 2019) version of PowerBI.
also, I am attaching some screenshot of the results I got in RStudio.
Unless I'm mistaken, the output of an R Script in PowerBI needs to be a plot of some kind (ggplot, etc). You are just creating a data frame and attempting to output it.
Here is the documentation for R in PowerBI:
I just need the dataframe with the score and output it to the PowerBI from the R script I added. I don't want to create any visualization in R , for that part I think powerBI is a much better tool .
I have done this (importing a dataframe as an output) in powerBI with other R packages. But seems like the problem is only for using this 'sentimentr' package.
By any chance is it still not supported fully by powerBI although the official documentation says so.
What you are describing is using R as a data source, as documented here:
I only have experience using R visuals. I would recommend you start a new topic and get help from others, or contact support.
It’s time for another PBI Community recap!
Visit our Community Blog for articles, guides, and information created by fellow community members.
Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.
Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!