stat summary: add combined functions: fn_data: mean_sdl / mean_se

Aperta
#1,507 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
kotlin, python

Direzione di ricerca

Inizia dall’implementazione di stat="summary" e segui come vengono gestiti fn, fn_min e fn_max; poi esamina i test di summary esistenti, se disponibili. Definisci il comportamento combinato di fn_data e fn_args per mean_sdl e mean_se, incluse le aesthetics predefinite y, ymin e ymax; il lavoro è completato quando entrambi gli esempi proposti producono il centro e i limiti attesi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Stat summary can't produce the very common mean ± SD / SE chart (error bar / pointrange / ribbon). Its fn / fn_min / fn_max parameters take only point aggregations — count, sum, mean, median, min, max, lq, mq, uq — none of which express a spread-based interval.

What's missing is any spread-based bound (SD, SE). It's structurally different: ymin = mean − k·SD is not a single-column aggregation — it's derived jointly from the center and the dispersion of the same column, so it can't be modeled as an independent fn_min / fn_max, and there's currently no slot for it.

Proposed
Add a combined summary function parameter — the analog of ggplot2's fun.data — that returns center and bounds together as the computed variables ..y.., ..ymin.., ..ymax..:

  • fn_data="mean_sdl" — mean ± k·SD (ggplot2 default k = 2)
  • fn_data="mean_se" — mean ± k·SE

with a multiplier parameter (ggplot2 passes fun.args=list(mult=…)), e.g. fn_args={'mult': 1}. This is a new mechanism alongside fn / fn_min / fn_max (use one or the other), mirroring ggplot2's fun vs fun.data. Ideally stat="summary" + fn_data sets the default ymin/ymax aesthetics so they needn't be re-mapped.

Desirable API

# cleanest — the stat provides default y/ymin/ymax
geom_pointrange(data=df, stat="summary", fn_data="mean_sdl")                # mean ± 2·SD
geom_pointrange(data=df, stat="summary", fn_data="mean_se", fn_args={'mult': 1})

# explicit form (also valid, for control)
geom_pointrange(data=df, stat="summary", fn_data="mean_sdl",
                mapping=aes(y='..y..', ymin='..ymin..', ymax='..ymax..'))
Lingua principale
Kotlin
Stelle
1.8k
Fork
63
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di JetBrains/lets-plot

Tutte le issue di JetBrains/lets-plot

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.