- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
R print or summary visualization
Does anyone know how you can show the result of an R script in a dashboard?
And I don't mean the charts, but for example the result of the r script :
input <- warpbreaksprint(head(input))
output <-glm(formula = breaks ~ wool+tension, data = warpbreaks, family = poisson) print(summary(output))
Thank You!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I haven't tested the solution on summary() outputs, but I have done this with a numeric output value. A way around this is to utilize ggplot() + geom_text() in order to output a text value. I used this in a predict function where:
p <- predict(fit, test.data)
ggplot() + geom_text(aes(0, 0, label = p))
That got me a plot that has my numeric value in the center. If you mess around with the arguments available for the function you can make it look a lot nicer than that. It's not great, but it works until Power BI starts allowing us to output printed values to a report.
If that works, please mark it as a solution. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it's a bit of a workaround, but the gridExtra package should be able to do what you're after - grid.table() instead of print can be used to display the result of the summary function (see here for more detail on what it can do).
Note that this might not be completely what you're after, as it produces an image and displays that, rather than an actual table you can copy data out of.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another way would be to save the output in a text file and then create a table visual in PowerBi and pull the data with 0 width. The issue here is one would need to refresh the table visual.
require(gridExtra) pathToProject <- "F:\\PowerBIDocuments\\" t <- summary(dataset$hwy) grid.table(t) out <- capture.output(t) cat(out, file=paste0(pathToProject,"results.txt"), sep="\n", append=FALSE)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@fverhagen In power bi desktop you can use R script visual to visualise output of R scripts. However it is currently not supported in power bi service and you will only find it working in power bi desktop. Please vote for my idea here to have R visual support in power bi service. Check this blog post on using R visuals in power bi desktop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unrelated and doesn't answer the question (explicitly about outputting the data from an R script, not a visualisation).
Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Microsoft Fabric Community Conference 2025
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
Subject | Author | Posted | |
---|---|---|---|
05-15-2024 09:32 AM | |||
07-11-2024 11:26 AM | |||
03-12-2024 06:12 AM | |||
12-29-2024 12:09 PM | |||
01-19-2022 04:54 AM |
User | Count |
---|---|
126 | |
81 | |
59 | |
57 | |
43 |
User | Count |
---|---|
183 | |
111 | |
82 | |
65 | |
50 |