Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

moai-lang-r

БесплатноБез исполняемых скриптовНе проверен

R 4.4+ development specialist covering tidyverse, ggplot2, Shiny, and data science patterns. Use when developing data analysis pipelines, visualizations, or…

modu-aiот modu-ai★ 69 звёзд на GitHub18 установок в других каталогах

Об этом скилле

Quick Reference (30 seconds)

R 4.4+ Development Specialist - tidyverse, ggplot2, Shiny, renv, and modern R patterns.

Auto-Triggers: Files with .R extension, .Rmd, .qmd, DESCRIPTION, renv.lock, Shiny or ggplot2 discussions

Core Capabilities:

  • R 4.4 Features: Native pipe operator, lambda syntax with backslash, improved error messages
  • Data Manipulation: dplyr, tidyr, purrr, stringr, forcats
  • Visualization: ggplot2, plotly, scales, patchwork
  • Web Applications: Shiny, reactivity, modules, bslib
  • Testing: testthat 3.0, snapshot testing, mocking
  • Package Management: renv, pak, DESCRIPTION
  • Reproducible Reports: R Markdown, Quarto
  • Database: DBI, dbplyr, pool

Quick Patterns

dplyr Data Pipeline Pattern:

Load tidyverse library. Create result by piping data through filter for year 2020 or later, mutate adding revenue_k as revenue divided by 1000 and growth as current minus lagged revenue divided by lagged revenue, group_by category, then summarise with total_revenue as sum, avg_growth as mean with na.rm TRUE, and groups set to drop.

ggplot2 Visualization Pattern:

Load ggplot2 library. Create ggplot with data and aes mapping x to date, y to value, and color to category. Add geom_line with linewidth 1 and geom_point with size 2. Apply scale_color_viridis_d for color scale. Add labs for title, axis labels, and color legend. Apply theme_minimal for clean appearance.

Shiny Basic App Pattern:

Load shiny library. Create ui using fluidPage with selectInput for variable selection from mtcars column names and plotOutput for plot. Create server function with input, output, and session parameters. In server, assign renderPlot to output plot using ggplot with mtcars and aes using .data pronoun with input variable for histogram. Create app with shinyApp passing ui and server.


Implementation Guide (5 minutes)

R 4.4 Modern Features

Native Pipe Operator:

Create result by piping data through filter removing NA values, mutate adding log_value as log of value, and summarise computing mean_log. For non-first argument position, use underscore placeholder in lm formula call with data parameter.

Lambda Syntax with Backslash:

Use map with data and backslash x syntax for x squared. Use map2 with two lists and backslash x y for x plus y. In dplyr contexts, use mutate with across on numeric columns applying backslash x for scale function extracting first column.

tidyverse Data Manipulation

dplyr Core Verbs:

Load dplyr library. Create processed by piping raw_data through filter for active status and positive amount, select for specific columns, mutate adding month using floor_date and amount_scaled dividing by max, then arrange descending by date. For grouped summaries, pipe through group_by, summarise with n for count, sum and mean for aggregations, and groups drop.

tidyr Reshaping Pattern:

Load tidyr library. For wide to long transformation, use pivot_longer with cols starting with year prefix, names_to for column name, names_prefix to strip, and values_to for values. For long to wide transformation, use pivot_wider with names_from and values_from, adding values_fill for missing value handling.

purrr Functional Programming:

Load purrr library. Use map with files and lambda to read_csv each file. Use map_dfr for row-binding with id parameter for source column. Use map_dbl for extracting numeric results with mean and na.rm TRUE. For error handling, create safe_read using safely wrapper on read_csv. Map files through safe_read, extract results, and use compact to filter successes.

ggplot2 Visualization Patterns

Complete Plot Structure:

Load ggplot2 and scales libraries. Create p using ggplot with data and aesthetics for x, y, and color by group. Add geom_point with alpha and size, geom_smooth with lm method and standard error. Apply scale_x_continuous with comma labels, scale_y_log10 with dollar labels, and scale_color_brewer with Set2 palette. Add facet_wrap by category with free_y scales. Add labs for title, subtitle, and axis labels. Apply theme_minimal with base_size and theme for legend position. Save with ggsave specifying filename, plot, dimensions, and dpi.

Multiple Plots with patchwork:

Load patchwork library. Create p1 with histogram, p2 with scatter plot, and p3 with boxplot. Combine using pipe and parentheses for layout with p1 beside p2 over p3. Add plot_annotation for title and tag_levels.

Shiny Application Patterns

Modular Shiny App:

Create dataFilterUI function taking id parameter. Use NS function for namespace. Return tagList with selectInput for category with NULL initial choices and sliderInput for range. Create dataFilterServer function taking id and data reactive. Use moduleServer with inner function. In observe block, extract unique categories and updateSelectInput. Return reactive filtering data by category and range inputs using req for input validation.

Reactive Patterns:

In server function, create processed_data as reactive caching filtered data by

Полный SKILL.md на GitHub

Установить moai-lang-r в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Grep
Glob
Bash(R:*)
Bash(Rscript:*)
mcp__context7__resolve-library-id
mcp__context7__get-library-docs

Вложенные файлы

modules/advanced-patterns.mdreferences/examples.mdreferences/reference.md

FAQ

Что делает скилл moai-lang-r?

R 4.4+ development specialist covering tidyverse, ggplot2, Shiny, and data science patterns. Use when developing data analysis pipelines, visualizations, or Shiny applications.

Как установить скилл moai-lang-r?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл moai-lang-r запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить moai-lang-r с