The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I wanted to test out the R script integration and ran into an error I cannot figure out how to get past.
I have R running and it will works with the basic "Iris" data set, but not for the one I want to use.
I want to access the Quandl datasets and installed the necessary Library and Package. I create a script in RStudio and ran it and it worked as expected pulling in data from Quandl.
It does not work when calling from PowerBI. I get the error " Unable to connect" ADO.NET: R script error: Could not find function "Quandl"
Looking at the PowerBI seciton I found a document that outlines the connection : https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-r-scripts/access
AND... Specifally calls out this "To run the script in Power BI Desktop, make sure the script runs successfully in a new and unmodified workspace. This means that all packages and dependencies must be explicitly loaded and run. You can use source() to run dependent scripts."
When I open up Rstudio or just R, the quandl package does not load automatically. So, my long drawn out question is this. The sample call I'm trying to make to Quandl is this: mydata = Quandl("FRED/GDP"). Can I enter that call into the PowerBI connection and expect to return results. Or do I reference the script I worte with the call in it called: Quandl_GDP. Either way neiter work, but I wanted to see which was the right path.
Thanks in advance
Rich
Hi Woodfin and thanks for the feedback,
I think the root cause for this is that packages are not loaded explicitly.
Does your script use ' library(PACKAGENAME) ' ? if not you should add these to make sure R knows to load the required packages.
As for 'Source()', in case you still need to use it: this is used for running additional scripts within yours. In this case you'd need to 'SetWD()' in the script before calling it or explicitly use the full path to your script. If not then R in PBI will not locate it correctly.
Let us know if this helps,
thanks, Avi Sander(PBI)
User | Count |
---|---|
77 | |
77 | |
36 | |
30 | |
28 |
User | Count |
---|---|
106 | |
96 | |
55 | |
49 | |
46 |