r-visuals

Creates R script visuals with ggplot2 for Power BI PBIR reports.

6|3|Updated Jul 4, 2026
One-click install
npx skills add https://github.com/InsightfulAnalytics/PBI_Agentic_Dev --skill r-visuals-insightfulanalytics
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: r-visuals
Source: https://github.com/InsightfulAnalytics/PBI_Agentic_Dev/tree/main/plugins/custom-visuals/skills/r-visuals
Command: npx skills add https://github.com/InsightfulAnalytics/PBI_Agentic_Dev --skill r-visuals-insightfulanalytics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building R script visuals in Power BI requires knowing the PBIR JSON structure, DAX literal escaping rules, ggplot2 rendering requirements, and Service-vs-Desktop limitations. This Skill provides the complete workflow for creating, injecting, and validating R visuals in PBIR reports without trial-and-error. ## Core Features & Use Cases - End-to-end R visual workflow: Create the visual.json with scriptVisual type, write ggplot2 scripts against the auto-injected dataset data.frame, inject the script with correct escaping, and validate with jq. - ggplot2 pattern library: Ready-made patterns for bar charts, donut charts, line charts, heatmaps, bullet charts, and faceted small multiples, plus real-world visual.json examples. - Platform constraint guidance: Covers the 150,000-row cap, distinct-row grouping behavior, Service text rendering flags, CJK font handling, and timeout/output limits. - Use Case: A report developer needs a bullet chart comparing current-year order lines to prior year with conditional colors driven by DAX measures. The Skill supplies the ggplot2 script, the escaped visual.json structure, and validation steps. ## Quick Start Ask the agent to create an R visual in the Power BI report that plots sales by category as a ggplot2 bar chart and inject it into the PBIR visual.json.

Frequently Asked Questions about r-visuals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an R visual in a Power BI PBIR report?▼

Create a visual.json with visualType scriptVisual, bind columns and measures to the Values role, then place the R script in objects.script[0].properties.source as a single-quoted DAX literal with newlines escaped as \n. Validate the result with jq empty.

Why is my ggplot2 chart blank in a Power BI R visual?▼

ggplot2 objects do not auto-display in Power BI; you must explicitly call print(p) at the end of the script. Also guard against empty data with an nrow(dataset) == 0 check so the visual renders a fallback message instead of failing.

R visual vs Python visual in Power BI, which should I use?▼

Use R for publication-quality statistical plots and packages like forecast, corrplot, and pheatmap. Use Python when the computation relies on scikit-learn, statsmodels, or scipy, or when the report already uses Python scripts.

What R packages are supported in the Power BI Service?▼

The Service runs R 4.3.3 with roughly 1000 CRAN packages including ggplot2, dplyr, tidyr, ggrepel, patchwork, and forecast. Packages requiring networking such as RgoogleMaps and mailR are not supported; Desktop has no package restrictions.

Why does my R visual work in Desktop but fail in the Service?▼

Text rendering in the Service requires powerbi_rEnableShowText = 1 as the first script line, and CJK characters need powerbi_rEnableShowTextForCJKLanguages = 1 plus the showtext package. Desktop silently ignores these flags while the Service drops text without them.

What are the limitations of R script visuals in Power BI?▼

R visuals render static PNGs at 72 DPI with a 150,000-row cap on deduplicated input, 5-minute Desktop and 1-minute Service timeouts, and no cross-filtering from the visual. They also cannot be used with publish-to-web or app-owns-data embedding.