Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Question]: Making easier to add piped expression to qenv

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
r
領域
data

調査の方向性

まず、既存の qenv API と within API が式をどのように取得・検証するか、また get_code がそれらをどのようにレンダリングするかを比較します。提案されている add_pipe ワークフローと teal_data との相互作用を確認します。完了条件は、不完全なパイプを追加して呼び出しをまたいで継続でき、式が終了するまで検証が遅延されることです。

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

説明

core question
What is your question?

With within is very easy to add a complete expression to qenv.

The pipe has the benefit of reducing the allocation of variables and removing a parameter as is passed implicitly and potentially make code more readable.
R users use/expect pipes (%>% and |> mostly) and often they are created step by step.
If the piped expression is not completed it results in an error, so module developers need to write first the complete expression and then add it to the qenv/teal_data:

library("qenv")
q <- within(qenv(), {
  p <- penguins
})

within(q, {
  p %>% 
    subset(!is.na(sex)) %>% 
})
#> Error: unexpected '}' in:
#> "    subset(!is.na(sex)) %>% 
#> }"

It would be great if there were some method/function to be able to append an incomplete piped expression to be continued.
An idea:

q2 <- add_pipe(q, {p <- p %>% subset(!is.na(sex))}, pipe = "%>%")
cat(get_code(q2))
#> p <- penguins
#> p<- p %>% subset(!is.na(sex)) %>% { }

q3 <- add_pipe(q2, {head()}, pipe = "")
cat(get_code(q3))
#> p <- penguins
#> p <- p %>% subset(!is.na(sex)) %>% head()

Adding an empty character instead of the (default?) pipe could signal the end of the pipeable expression.
Only then the code would be verified.

Code of Conduct
  • I agree to follow this project's Code of Conduct.
Contribution Guidelines
  • I agree to follow this project's Contribution Guidelines.
Security Policy
  • I agree to follow this project's Security Policy.
主要言語
R
スター
11
フォーク
9
平均マージ
6日 2時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

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

insightsengineering/teal.data のほかの issue

insightsengineering/teal.data の issue をすべて見る

似ている issue

R の issue をもっと見る

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

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