I am running some simple commands in R within the PowerBI software:
However, the results won't show in the PowerBI Dashboard and I keep having this error:
What is happening and how can I show some simple results of R functions in PowerBI?
Related
I am trying to load elasticsearch(through elasticstash) data onto R for the first time. I am running into an error as is shown in the screenshot below. What can I do to get the data into R?
Some code that I've tried:
Error message:
I am trying to use Bloomberg Excel built in functions (BCurve, BView,...) in Python. I am currently using xlwings and i have tried using some of the posts that explain how to run macros from Python using win32com, but I have not seen how to capture the range of cells that are output of the function and avoiding importing the results before the function has completed running.
Running an Excel macro via Python?
I have some tables, e.g. tbl_A, tbl_B & tbl_C that are created in Power BI using R script.
The R script is like this :
df2 <- read.csv("data/customer.csv",quote="")
df2 <- read.csv("data/order.csv",quote="")
#performing various joins / aggregating data
tbl_A <- ...
tbl_B <- ...
tbl_C <- ...
And I choose to load tbl_A, tbl_B & tbl_C when the R script finish executing.
Then those tables are visualized with PowerBI visualization tools such as stacked bar charts.
Everything works fine at this point.
The issue I have is that I would need to update the data (because there is new data everyday) without having each time to recreate the charts.
I tried re-running the R script and loading tbl_A, tbl_B & tbl_C, but this creates new powerBI tables (tbl_A (2), tbl_B (2) ...) and thus is not updating the data that is used in the charts.
Is there any way to update the data generated by R scripts used in PowerBI visualizations ?
Sadly this is not possible as of the current level of R integration in PowerBI.
PowerBI R visualization integration is performed by importing the visual into PowerBI as a static Image. This is explained in the microsoft documentation due to the below limitation:
R visuals are refreshed upon data updates, filtering, and highlighting. However, the image itself is not interactive and cannot be the source of cross-filtering.
R visuals respond to highlighting other visuals, but you cannot click on elements in the R visual in order to cross filter other elements.
Only plots that are plotted to the R default display device are displayed correctly on the canvas. Avoid explicitly using a different R display device.
Basically, PowerBI doesn't incorporate the R graphics device directly into the GUI / visual interface, but rather imports the image. I believe this might be due to how R is integrated. Every R scripts seems to be executed as a self-contained R-session, which closes once the script has finished. Any leftover graphics and data will thus be terminated, and one would have to rerun the script to gain access to the data again.
I'm developing a Shiny application that provides interaction between a table with selection and a plot also with selection. When the plot is clicked to select a point, I would like to cascade that selection to the table. I've found this page (https://yihui.shinyapps.io/DT-proxy/) which describes exactly the process I'm trying to accomplish using dataTableProxy and selectRows functions. But even their example code does not work on my machine. I get an error saying "could not find function dataTableProxy"
I have version 0.1 of DT, shiny 0.12.2, shinydashboard 0.5.1, and R 3.1.2. Even looking at the DT documentation I see no mention of a dataTableProxy function.
I am sending passing R scripts to R from Tableau and would like to be able to see the result in the R console. I have got this to work in the past, but not sure how to do it again.
In R I've ran the following lines of code:
Note, [Petal Length] is just a column of number values- it doesn't matter what the numbers are. In this case I just got it from the IRIS dataset (which is pre-packaged in R as you can see if you run data())
install.packages("Rserve")
library(Rserve)
run.Rserve()
In Tableau, the calulated field that contains the R script is:
SCRIPT_INT('print(.arg1)', SUM([Petal length]))
Thanks.
After some searching I finally found the answer to this question. 1) you have to have the function print() in the Tableau calculated field, and 2) you have to use the command: run.Rserve() as opposed to Reserve().