Logo: Karthik R Code Style

Karthik R Code Style

Communautéit
skthewimp
karthik-r-code-style

Use whenever you write or edit R for Karthik - scripts, RMarkdown/Quarto chunks, ggplot code - to lay it out in his style: one pipe (%>% or |>) per line, right-assigned pipelines ending in ->, multi-argument calls expanded one arg per line with the closing bracket on its own line, ggplot layers with + at end of line, 2-space nested indentation, and modern comma/operator spacing. Layout only; idiom and workflow live in karthik-r-analysis-style.

Iwwersiicht

Editeurskthewimp
Repositorykarthik-data-visualization-skill
Skill-Nummkarthik-r-code-style
Stären
49
Forks
5
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    skthewimp huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Karthik R Code Style an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/skthewimp/karthik-data-visualization-skill/tree/main/karthik-r-code-style/codex
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/skthewimp/karthik-data-visualization-skill.git /tmp/karthik-data-visualization-skill
mkdir -p .claude/skills
cp -r /tmp/karthik-data-visualization-skill/karthik-r-code-style/codex .claude/skills/karthik-r-code-style
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Karthik R Code Style an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Karthik R Code Style automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Karthik R Code Style net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Karthik R Code Style

Use whenever you write or edit R for Karthik - scripts, .Rmd/.qmd chunks, ggplot code, anything. This skill governs layout: line breaks, indentation, bracket expansion, assignment direction, spacing. It does not govern which idioms or which analysis to write - that is karthik-r-analysis-style. Apply both together when generating a notebook; apply this one alone when the request is just "format this" or "write this in my R style".

LLM-generated R packs everything onto long horizontal lines. Karthik's R breaks vertically so each step reads as its own line and a pipeline can be run line by line while exploring. Default to the expanded layout below; don't wait to be asked for it.

The rules

1. One pipe per line

Every %>% or |> ends its line. The source object sits at the pipeline's base indent; each following verb goes on a new line, indented one step (2 spaces) under it.

r
movie_shows %>%
  arrange(show_id, desc(start_at)) %>%
  distinct(show_id, .keep_all = TRUE) %>%
  mutate(show_date = as_date(start_at))

Never chain two verbs on one line (x %>% filter(...) %>% select(...) on a single line is wrong for anything beyond a throwaway one-liner).

2. Right-assign pipelines

A pipeline that builds a named object ends with right assignment, so the chain can be selected and run top-down. Always put -> at the end of the expression and the target object on the next line, indented 2 spaces from the pipeline's base indent. Never put the target on the same line as ->, even for a short expression.

r
shows %>%
  summarise(
    first_show_date = min(show_date),
    .by = movie_id
  ) ->
  movie_show_dates

movie_show_dates %>%
  left_join(selected_releases, by = "movie_id", relationship = "one-to-one") ->
  movie_releases

Reserve <- for short, single-line assignments that are not pipelines (outdir <- "report_assets", emph <- "#C6462F"). Reading a file into a name also uses right assignment with the target on the next line:

r
read_parquet(path) ->
  movie_shows

3. Expand multi-argument calls

When a call carries several arguments, or won't sit comfortably on one line, put ( at the end of the line, one argument (or one logical group) per line indented one step, and the closing ) on its own line at the call's base indent. The next %>% or -> follows the ); after ->, put the target object on the next line.

r
screens_raw %>%
  summarise(
    rows = n(),
    seat_values = n_distinct(seats),
    .by = screen_id
  ) ->
  screen_capacity

For per-operation grouping (the default in karthik-r-analysis-style), put .by = key or .by = c(key1, key2) last, on its own argument line inside mutate(), summarise(), or another supporting verb. Avoid a surrounding group_by() / ungroup() pair for a single grouped operation.

Don't expand trivial calls. n(), select(chat_id, year), count(uuid) stay inline - the rule is for calls with real argument lists, not every set of parentheses.

4. ggplot: + per line

Each layer ends with +; the next geom_*, scale_*, labs(), annotate(), theme() goes on its own line indented one step under ggplot(...). A single layer with many arguments expands by rule 3.

r
ggplot(arc, aes(year)) +
  geom_line(aes(y = affection), colour = emph, linewidth = 1.3) +
  geom_point(aes(y = affection), colour = emph, size = 2.4) +
  labs(
    title = "The relationship, in two lines",
    subtitle = "Mean coded affection and tension per chat, by year"
  ) +
  base_theme

5. Indent is 2 spaces, and it nests

One step is two spaces. A bracket opened inside an already-indented line adds another two. Align the closing bracket with the line that opened it.

6. Spacing

Space after every comma. Spaces around = in named arguments and around operators (year >= 2008, by = "movie_id"). This is the modern-notebook convention; ignore the cramped no-space style of the pre-2016 base-R files on disk.

What this is not

Not a linter to run over Karthik's old code - old hand-written files keep their own style, including base-R Allman braces and cramped spacing. This skill shapes new R you generate. Idiom choice (tidyverse over base R, cummean over index loops, no raw SQL) and notebook structure live in karthik-r-analysis-style; final chart design lives in karthik-data-visualization.

Heefeg gestallte Froen

Wat mécht de KI-Skill Karthik R Code Style?

Use whenever you write or edit R for Karthik - scripts, RMarkdown/Quarto chunks, ggplot code - to lay it out in his style: one pipe (%>% or |>) per line, right-assigned pipelines ending in ->, multi-argument calls expanded one arg per line with the closing bracket on its own line, ggplot layers with + at end of line, 2-space nested indentation, and modern comma/operator spacing. Layout only; idiom and workflow live in karthik-r-analysis-style.

Firwat Karthik R Code Style op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Karthik R Code Style besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Karthik R Code Style an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/skthewimp/karthik-data-visualization-skill/tree/main/karthik-r-code-style/codex an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Karthik R Code Style benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Karthik R Code Style benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Karthik R Code Style domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Karthik R Code Style gratis?

Jo. skthewimp huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇