R visual creation and ggplot2 patterns for PBIR reports. An agent skill from data-goblin/power-bi-agentic-development.

GPL-3.0Auto-check passedData & Analytics

Install R Visuals

skills CLI
$ npx skills add data-goblin/power-bi-agentic-development --skill r-visuals -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install data-goblin/power-bi-agentic-development r-visuals --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/data-goblin/power-bi-agentic-development.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/custom-visuals/skills/r-visuals .claude/skills/r-visuals && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
r-visuals
GitHub stars
1k
Token cost
~2.3k tokens
SKILL.md length
939 words
Files
10 (incl. references)
Skills in repo
33
Repo updated
First seen
Licence
GPL-3.0

At a glance

R visual creation and ggplot2 patterns for PBIR reports. An agent skill from data-goblin/power-bi-agentic-development.

  • Works in 4 steps: Add the Visual → Write the Script → Inject the Script → …
  • Mentions R visual
  • SKILL.md covers Visual Identity, Workflow: Creating an R Visual, PBIR Format and Supported Packages, plus 8 more sections
  • Runs R scripts from its folder

What it does

R Visuals is an agent skill from data-goblin/power-bi-agentic-development. R visual creation and ggplot2 patterns for PBIR reports. Automatically invoke when the user mentions "R visual", "ggplot2", "ggplot in Power BI", or asks to "create an R visual", "add an R chart", "write an R visual script", "inject an R script into Power BI".

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 13 other files, including reference files (for example `examples/visual/bar-chart.json`, `examples/visual/bullet-chart.json` and `examples/visual/trend-line.json`).

It sits in Data & Analytics. It works with Power BI. The repository describes itself as: Power BI AI skills and Power BI agents for Claude Code and GitHub Copilot: a plugin marketplace of Power BI skills, subagents, and hooks for semantic models, DAX, TMDL, reports… The licence is GPL-3.0.

When your agent uses it

  • Mentions R visual
  • Ggplot in Power BI
  • Asks to create an R visual
  • Write an R visual script

Example prompts

  • “R visual”
  • “ggplot2”
  • “ggplot in Power BI”
  • “/r-visuals”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Add the Visual
  2. Write the Script
  3. Inject the Script
  4. Validate

What it can do on your machine

Read from SKILL.md and the folder at commit 41886f2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (R), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.microsoft.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

R Visuals loads about 2.3k tokens when it runs, and up to ~5.1k if it reads all its reference files. Until then it costs about 68 tokens; SKILL.md has 939 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~68
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from data-goblin/power-bi-agentic-development at commit 41886f2, republished under its GPL-3.0 licence (© data-goblin). 939 words, ~2,310 tokens.

Download SKILL.mdSave it as .claude/skills/r-visuals/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
r-visuals
description
R visual creation and ggplot2 patterns for PBIR reports. Automatically invoke when the user mentions "R visual", "ggplot2", "ggplot in Power BI", or asks to "create an R visual", "add an R chart", "write an R visual script", "inject an R script into Power BI".

R Visuals in Power BI (PBIR)

Use pbir for every report mutation. Read PBIR metadata only for diagnosis. If pbir is unavailable or lacks an operation, stop and report the gap; never edit report JSON directly.

R visuals execute R scripts (primarily ggplot2) to render static PNG images on the Power BI canvas. ggplot2 is the preferred library -- its grammar of graphics approach produces clean, publication-quality statistical visualizations with less code. R is particularly strong for statistical visualizations.

Visual Identity

  • visualType: scriptVisual
  • Data role: Values (columns and measures, multiple allowed)
  • Data variable: dataset (data.frame, auto-injected)
  • Row limit: 150,000 rows
  • Output: Static PNG at 72 DPI -- no interactivity

Workflow: Creating an R Visual

Step 1: Add the Visual
bash
pbir add visual scriptVisual "Report.Report/Page.Page" --name RevenueByDateR \
  --data "Values:Sales.Date" --data "Values:Sales.Revenue"
Step 2: Write the Script
r
library(ggplot2)

p <- ggplot(dataset, aes(x=Date, y=Sales)) +
  geom_col(fill="#5B8DBE") +
  theme_minimal(base_size=12) +
  theme(panel.grid.major.x=element_blank())

print(p)  # MANDATORY for ggplot2

Critical rules:

  • print(p) is mandatory for ggplot2 objects -- they do not auto-display in Power BI
  • dataset is auto-injected as a data.frame; do not create it
  • Access columns by index (dataset[,1]) to avoid name escaping issues
  • Use backticks for column names with spaces: dataset$`Order Lines`
Step 2b: Review

Before presenting the script to the user, dispatch the r-reviewer agent to validate correctness and provide design feedback.

Step 3: Inject the Script
bash
pbir visuals r "Report.Report/Page.Page/RevenueByDateR.Visual" --script-file chart.r

The CLI handles PBIR string escaping.

Step 4: Validate
bash
pbir visuals bind "Report.Report/Page.Page/RevenueByDateR.Visual" --show
pbir validate "Report.Report" --all

PBIR Format

For read-only diagnosis, scripts are stored in visual.objects.script[0].properties:

json
{
  "source": {"expr": {"Literal": {"Value": "'library(ggplot2)\\n...\\nprint(p)'"}}},
  "provider": {"expr": {"Literal": {"Value": "'R'"}}}
}

Identical structure to Python visuals except visualType is scriptVisual and provider is 'R'.

Supported Packages

Power BI Service (R 4.3.3)
PackageVersionPurpose
ggplot23.5.1Grammar of graphics
dplyr1.1.4Data manipulation
tidyr1.3.1Data tidying
ggrepel0.9.5Non-overlapping labels
patchwork1.2.0Compose multiple plots
cowplot1.1.3Publication-quality plots
corrplot0.94Correlation matrices
viridis0.6.5Color scales
RColorBrewer1.1-3Color palettes
forecast8.23.0Time series forecasting
pheatmap1.0.12Heatmaps
treemap2.4-4Treemaps
lattice0.22-6Trellis graphics

~1000 CRAN packages available. Not supported: packages requiring networking (RgoogleMaps, mailR).

Full package list: https://learn.microsoft.com/power-bi/connect-data/service-r-packages-support

Desktop

Any locally installed R package works without restriction. R must be installed separately.

Best Practices

  1. Always call print(p) -- ggplot2 objects require explicit printing
  2. Guard against empty data -- if (nrow(dataset) == 0) { plot.new(); text(0.5, 0.5, "No data") }
  3. Use index-based column access -- dataset[,1] avoids name escaping issues
  4. Use theme_minimal() -- clean aesthetic that works well with Power BI
  5. Factor categorical variables -- control sort order explicitly with factor()
  6. Use hex colors matching the report theme
  7. Set margins -- plot.margin=margin(t, r, b, l) to prevent clipping
  8. Keep scripts concise -- 5-min timeout Desktop, 1-min Service

Limitations

ConstraintDesktopService
OutputStatic PNG, 72 DPIStatic PNG, 72 DPI
Timeout5 minutes1 minute
Row limit150,000150,000
Output size2 MB30 MB
NetworkingUnrestrictedBlocked
GatewayPersonal onlyPersonal only
Cross-filter FROMNot supportedNot supported
Receive cross-filterYesYes
Publish to webNot supportedNot supported
Embed (app-owns-data)Not supportedNot supported

Script Structure Template

r
library(ggplot2)

# 1. Guard against empty data
if (nrow(dataset) == 0) {
  plot.new()
  text(0.5, 0.5, "No data available", cex=1.5)
} else {
  # 2. Data preparation (index-based access)
  df <- data.frame(
    category = dataset[,1],
    value = dataset[,2]
  )

  # 3. Create visualization
  p <- ggplot(df, aes(x=reorder(category, -value), y=value)) +
    geom_col(fill="#5B8DBE", width=0.7) +
    theme_minimal(base_size=12) +
    theme(
      panel.grid.major.x = element_blank(),
      axis.title = element_blank()
    )

  # 4. Render
  print(p)
}

R vs Python Syntax Reference

For the language-choice decision, see the "When to Use a Script Visual" section above. This table covers only mechanical syntax differences for scripts already committed to R:

AspectR (scriptVisual)Python (pythonVisual)
Render callprint(p)plt.show()
Column accessdataset[,1] or dataset$coldataset.iloc[:,0] or dataset["col"]
Empty guardif (nrow(dataset) == 0)if len(dataset) == 0:
Factor/category orderfactor(x, levels=...)pd.Categorical(x, categories=...)
Runtime (Service)R 4.3.3Python 3.11
Show full SKILL.md (410 more words)Show less

When to Use a Script Visual

Reach for an R visual only when all of the following hold:

  • The chart has no native equivalent and no reasonable Deneb spec
  • The value is in a statistical computation that must run at render time (model fit, kernel density, forecast band), not just a shape Vega could draw
  • The visual does not need to be a cross-filter source, hover tooltips, publish-to-web, or app-owns-data embed
  • The report is served in a Pro/PPU or higher capacity with a Fabric-enabled region

If interactivity or cross-filtering matters, use Deneb (a static PNG cannot be a selection source). If the need is a small inline mark (sparkline, bar, status pill), use an SVG measure (no row cap, no timeout, no licensing/region gate, renders under publish-to-web). The script visual's niche is narrow: compute-at-render statistical plots for internal or org consumption.

R vs Python once a script visual is the right call: use R for publication-quality statistical defaults and packages with no Python peer (forecast, corrplot, pheatmap, ridgeline/violin). Use Python when the computation leans on scikit-learn, statsmodels, or scipy, or when surrounding report logic is already Python. Where equal, default to whichever language the report's other scripts use; mixing doubles the publish-time package surface to validate.

Do not default to a script visual because a chart type "looks statistical." A box plot, lollipop, or dumbbell is an SVG-measure or Deneb job; reserve scripts for charts that genuinely compute.

References

  • references/data-model.md -- dataset grouping mechanic, row/byte caps, forcing per-row input, and R-specific traps (Time type, text rendering flags, CJK fonts)
  • references/community-examples.md -- R Graph Gallery examples organized by chart type (distribution, correlation, ranking, evolution, flow)
  • references/ggplot2-patterns.md -- Common ggplot2 chart patterns (bar, donut, line, heatmap, bullet)
  • examples/script/ -- Standalone R scripts (bar-chart, trend-line) -- ready to inject into visual.json after escaping
  • examples/visual/bullet-chart.json -- PBIR visual.json: bullet chart with conditional coloring, error handling, and extensive escaping
  • examples/visual/bar-chart.json -- PBIR visual.json: horizontal bar with PY comparison lines and colored account labels
  • examples/visual/trend-line.json -- PBIR visual.json: area chart with ribbon plot and month factor handling

Fetching Docs

To retrieve current R visual / package support docs, use microsoft_docs_search + microsoft_docs_fetch (MCP) if available, otherwise mslearn search + mslearn fetch (CLI). Search based on the user's request and run multiple searches as needed to ensure sufficient context before proceeding.

  • pbi-report-design -- Layout and design best practices
  • python-visuals -- Python Script visuals (same concept, different language)
  • deneb-visuals -- Vega/Vega-Lite visuals (interactive, vector-based alternative)
  • svg-visuals -- SVG via DAX measures (lightweight inline graphics)
  • pbir-format (pbip plugin) -- PBIR JSON format reference

© data-goblin, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files (references) in plugins/custom-visuals/skills/r-visuals of data-goblin/power-bi-agentic-development.

  • SKILL.md
  • examples/script/bar-chart.R
  • examples/script/trend-line.R
  • examples/visual/bar-chart.json
  • examples/visual/bullet-chart.json
  • examples/visual/trend-line.json
  • examples/visual/ytd-line-chart.json
  • references/community-examples.md
  • references/data-model.md
  • references/ggplot2-patterns.md

Open the folder on GitHubat commit 41886f2

Compare with similar skills

R Visuals next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

R Visuals compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
R Visuals this skilldata-goblin/power-bi-agentic-development1k—~2.3kAutomated safety check: PassGPL-3.0
Power Bi AI ReadinessDKH-DK/Self-Service-Power-BI-Fabric113—~2kAutomated safety check: PassNone
Pbi Report Builderlukasreese/powerbi-claude-skills128—~7.5kAutomated safety check: PassNone
Pbi Docxperiun/skills-xperiun-free117—~3kAutomated safety check: PassMIT
Pbip Dependency Analyzerlukasreese/powerbi-claude-skills128—~3.2kAutomated safety check: PassNone
Pbi Modelo Reviewxperiun/skills-xperiun-free117—~2.9kAutomated safety check: PassMIT

Similar skills

  • Power Bi AI Readiness

    DKH-DK/Self-Service-Power-BI-Fabric

    Score and prepare Power BI semantic models for AI (Fabric Data Agent / Copilot).

    113 GitHub stars~2k tokensUpdated 3 mo ago
    Data & AnalyticsAuto-check passed
  • Pbi Report Builder

    lukasreese/powerbi-claude-skills

    [power-bi] Power BI PBIR Report Builder with IBCS Visuals. An agent skill from lukasreese/powerbi-claude-skills.

    128 GitHub stars~7.5k tokensUpdated 5 mo ago
    Data & AnalyticsAuto-check passed
  • Pbi Doc

    xperiun/skills-xperiun-free

    Documenta projeto Power BI (PBIP) inteiro em markdown estruturado + HTML navegável (mini-site de doc).

    117 GitHub stars~3k tokensUpdated 21 days ago
    Data & AnalyticsAuto-check passed
  • Pbip Dependency Analyzer

    lukasreese/powerbi-claude-skills

    Power BI PBIP Dependency Analyzer. An agent skill from lukasreese/powerbi-claude-skills.

    128 GitHub stars~3.2k tokensUpdated 5 mo ago
    Data & AnalyticsAuto-check passed
  • Pbi Modelo Review

    xperiun/skills-xperiun-free

    Audita modelo Power BI (PBIP) e gera relatório priorizado com anti-patterns, score 0-100 e recomendações acionáveis.

    117 GitHub stars~2.9k tokensUpdated 21 days ago
    Data & AnalyticsAuto-check passed
  • Pbi Dax Create

    xperiun/skills-xperiun-free

    Cria medida DAX a partir de descrição em PT, respeitando o modelo Power BI existente (colunas reais, naming convention, padrões DAX).

    117 GitHub stars~2.6k tokensUpdated 21 days ago
    Data & AnalyticsAuto-check passed

More from data-goblin/power-bi-agentic-development

All 33 skills in this repo
  • Paginated Report

    data-goblin/power-bi-agentic-development

    Author, validate, publish, and test Power BI paginated reports in the RDL format.

    1k GitHub stars~3.5k tokensUpdated 2 days ago
    Auto-check passed
  • Audit Tenant Settings

    data-goblin/power-bi-agentic-development

    Automatically invoke this skill whenever the user asks about Fabric tenant settings or Power BI tenant settings or auditing tenant settings.

    1k GitHub stars~4.7k tokensUpdated 2 days ago
    Auto-check passed
  • Bpa Rules

    data-goblin/power-bi-agentic-development

    Interactive BPA rule generation for Power BI semantic models; guided discovery, model investigation, and expert rule authoring.

    1k GitHub stars~4.4k tokensUpdated 2 days ago
    Auto-check passed
  • Pbip

    data-goblin/power-bi-agentic-development

    Guidance for Power BI Project (PBIP) structure, thick and thin reports, project renames, forks, and validation.

    1k GitHub stars~3.8k tokensUpdated 2 days ago
    Auto-check passed
  • Review Report

    data-goblin/power-bi-agentic-development

    Actionable feedback on the quality, usage, and effectiveness of Power BI reports.

    1k GitHub stars~4.2k tokensUpdated 2 days ago
    Auto-check passed
  • Semantic Model

    data-goblin/power-bi-agentic-development

    This skill should be used whenever the user mentions a "semantic model", "data model", or "dataset", or asks to "build", "model", "design", "optimize", "review", or "audit" one, or to "add a…

    1k GitHub stars~2.8k tokensUpdated 2 days ago
    Auto-check passed

Works with

Questions about R Visuals

What does R Visuals do?

R visual creation and ggplot2 patterns for PBIR reports. An agent skill from data-goblin/power-bi-agentic-development. R Visuals is an agent skill from data-goblin/power-bi-agentic-development. R visual creation and ggplot2 patterns for PBIR reports.

When should I use R Visuals?

R Visuals fits situations like: mentions R visual; ggplot in Power BI; asks to create an R visual; write an R visual script.

How do I install R Visuals in Claude Code?

Run `npx skills add data-goblin/power-bi-agentic-development --skill r-visuals -a claude-code`. Or copy the skill folder (plugins/custom-visuals/skills/r-visuals in data-goblin/power-bi-agentic-development) into .claude/skills/r-visuals in your project. Claude Code loads it when a task matches its description.

How do I install R Visuals in Codex?

Run `npx skills add data-goblin/power-bi-agentic-development --skill r-visuals -a codex`. Or copy the skill folder (plugins/custom-visuals/skills/r-visuals in data-goblin/power-bi-agentic-development) into .agents/skills/r-visuals in your project. Codex loads it when a task matches its description.

Can I use R Visuals in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add data-goblin/power-bi-agentic-development --skill r-visuals -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/r-visuals, .gemini/skills/r-visuals, .github/skills/r-visuals and .opencode/skills/r-visuals in your project.

What does R Visuals need to run?

Going by SKILL.md and its folder, R Visuals needs R for the scripts in its folder. Our summary lists: Python 3.

Does R Visuals access the network?

SKILL.md names 1 domain. As links in the text: learn.microsoft.com. This is read from the text; nothing was executed.

Is R Visuals safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does R Visuals use?

R Visuals is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does R Visuals use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.8k tokens, read only when the agent opens those files.

What are the alternatives to R Visuals?

Skills that share tags, products or a category with R Visuals: Power Bi AI Readiness (DKH-DK/Self-Service-Power-BI-Fabric, 113 stars), Pbi Report Builder (lukasreese/powerbi-claude-skills, 128 stars), Pbi Doc (xperiun/skills-xperiun-free, 117 stars) and Pbip Dependency Analyzer (lukasreese/powerbi-claude-skills, 128 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains R Visuals?

data-goblin (a GitHub user) maintains it in data-goblin/power-bi-agentic-development, which has 1,026 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on October 5, 2026.

Source: data-goblin/power-bi-agentic-development on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.