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

オープン
#1,507 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
kotlin, python

調査の方向性

stat="summary" の実装から始めて、fn、fn_min、fn_max がどのように処理されているかを追跡し、その後、既存の summary テストがあれば確認します。mean_sdl と mean_se に対する fn_data と fn_args の組み合わせた動作を、デフォルトの y、ymin、ymax aesthetics を含めて定義します。提案された両方の例で期待される中心値と境界値が生成されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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..'))
主要言語
Kotlin
スター
1.8k
フォーク
63
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JetBrains/lets-plot のほかの issue

JetBrains/lets-plot の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。