r-visuals

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

887|131|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/data-goblin/power-bi-agentic-development --skill r-visuals
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-visuals
Source: https://github.com/data-goblin/power-bi-agentic-development/tree/main/plugins/custom-visuals/skills/r-visuals
Command: npx skills add https://github.com/data-goblin/power-bi-agentic-development --skill r-visuals

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 format, the scriptVisual type, ggplot2 rendering rules like mandatory print(p) calls, and Service-specific constraints such as package whitelists and text-rendering flags. This Skill encodes that knowledge so an agent can add, script, inject, and validate R visuals without trial and error.

Core Features & Use Cases

  • End-to-end R visual workflow: Add a scriptVisual via the pbir CLI, write a ggplot2 script, inject it with pbir visuals r, and validate bindings with pbir validate.
  • ggplot2 pattern library: Ready-made patterns for bar charts, donut charts, line charts, bullet charts, correlation heatmaps, box plots, and faceted small multiples, plus complete PBIR visual.json examples.
  • Constraint and trap guidance: Covers the 150,000-row deduplicated cap, byte limits, Desktop vs Service timeouts, supported CRAN packages, and R-specific traps like the powerbi_rEnableShowText flag and CJK font handling.
  • Use Case: Ask the agent to add an R visual showing revenue by date to a PBIR report; it creates the visual, writes a guarded ggplot2 script, injects it, and validates the report.

Quick Start

Ask the agent to create an R visual with a ggplot2 bar chart on a report page and inject the script using the pbir CLI.

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?

Add a scriptVisual with the pbir CLI, bind columns or measures to the Values role, write a ggplot2 script that ends with print(p), then inject it using pbir visuals r with the script file. Finish by validating the report with pbir validate.

Why is my ggplot2 chart not rendering in Power BI?

ggplot2 objects do not auto-display in Power BI, so the script must end with an explicit print(p) call. Also confirm the provider is set to 'R' and the visualType is scriptVisual in the PBIR definition.

Which R packages are supported in the Power BI Service?

The Service runs R 4.3.3 with roughly 1000 approved CRAN packages, including ggplot2, dplyr, tidyr, ggrepel, patchwork, corrplot, forecast, and pheatmap. Packages requiring networking, such as RgoogleMaps and mailR, are not supported.

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

Use R for publication-quality statistical defaults and packages without Python peers 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.

Why does R visual text render on Desktop but disappear in the Service?

The Service requires powerbi_rEnableShowText = 1 as the first line of the script for text output; Desktop ignores it silently. For CJK characters, also set powerbi_rEnableShowTextForCJKLanguages = 1 and load the showtext package before any library() call.

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, a 5-minute Desktop and 1-minute Service timeout, and no cross-filtering from the visual. They also cannot be used with publish to web or app-owns-data embedding.