Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
stimada community,
I've been trying to use the R script visual in power BI to work with some R visualizations. I've watched over 3 videos to use these R scripts, but I have a basic problem that won't let me move forward.
In the image below you can see that I have uploaded 3 columns from a database to the R script, but these are not automatically loaded to the R script as is often the case in all the videos I have seen.
This is an example of what should happen when loading the columns to the visual, in the R script the dataset is automatically updated with the contents of the different columns.
I leave you the information of my R script configuration
What am I doing wrong?
Stay tuned, thank you very much.
Solved! Go to Solution.
Hi, @Syndicate_Admin
Do you create visual based on this tutorial? Are you sure that the R script in the background is running?
Create Power BI visuals using R - Power BI | Microsoft Docs
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
Hi, @Syndicate_Admin
Logically speaking, if the R script is successfully installed, it should be automatically generated. So I consider whether the version you installed is too high and powebi doesn't support it.
You can try to download the lower version.
Reference:
Learn which R packages are supported - Power BI | Microsoft Docs
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
Hi ,
I hope you can help me with the problem I have Re R scripting which is similar to this track
I have succesfully run many R scripts both in power Bi and the service.
My main problem is reading in RDS image file or even RDS csv compressed files in the service ..the sites are open public Github sites .. all code works in the desktop ..even reading from all the github sites IN THE VISUAL R SCRIPTS . But when I run it in the service to the same sites it keeps saying the following
with the following code in the R visual :
Error in gzfile(file, "rb") : cannot open the connection In addition: Warning message: In gzfile(file, "rb") : cannot open compressed file 'https://github.com/gbortz27/aizatron/blob/main/mytitanic.rds?raw=true', probable reason 'No such file or directory exists"
OR with this code
url4="https://github.com/gbortz27/aizatron/blob/main/mytitanic.rds?raw=true"
#data <- readRDS(url(url4, method="libcurl"))
#data=readRDS(gzcon(url(url4)))
data=read_rds(url4)
ggplot(data,aes(x=Age,y=Fare)) +geom_point()
url4="https://github.com/gbortz27/aizatron/blob/main/mytitanic.rds?raw=true"
data <- readRDS(url(url4, method="libcurl"))
#data=readRDS(gzcon(url(url4)))
#data=read_rds(url4)
ggplot(data,aes(x=Age,y=Fare)) +geom_point()
Hi @Anonymous
This thread has been solved. If you have problems and are more complicated, I suggest you open a new thread. There will be other engineers to help you.
Best Regards,
Community Support Team _ Janey
Hi, @Syndicate_Admin
Do you create visual based on this tutorial? Are you sure that the R script in the background is running?
Create Power BI visuals using R - Power BI | Microsoft Docs
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
I've done the tutorial you sent, and it works, but not as I expected.
If you look at code line 3, I have manually added "dataset <- data.frame()" and within this I have not added any of the columns that appear in the visual on the right. Still, the code works, but I still do not understand the reason why the dataset is not created automatically with the columns that I am adding, it is a strange problem but at least now I can use some R libraries in Power BI. Thank you very much for the link, if you have information regarding why the dataset is not automatically generated I would appreciate it.
Hey @Syndicate_Admin ,
what happens if you remove the #-character that can be seen in line 3 of the R script?
Regards,
Tom
If I delete only the # of line 3 it looks like this
Columns added to the visual are still not added to the data.frame. Now, if I remove the entire line 3
nothing happens either, I just run out of my data.frame. I don't understand why the data.frame doesn't update automatically when you add columns to the visual. What do you recommend I try?
Hi, @Syndicate_Admin
Logically speaking, if the R script is successfully installed, it should be automatically generated. So I consider whether the version you installed is too high and powebi doesn't support it.
You can try to download the lower version.
Reference:
Learn which R packages are supported - Power BI | Microsoft Docs
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
You're right, you have to wait for a Power BI update about it, despite this, I've been able to use the R scripts I needed. I have loaded the columns to the visual object and in line 3 I have put "# dataset<-data.frame()", line 4 I have not touched, and with this the dataset considers all the columns that I have incorporated into the visual object, although I do not mention them within the data.frame. Thank you very much for the information.
Best regards.