[Question]: Making easier to add piped expression to qenv
还没有人认领这个 Issue。
评估
调研方向
首先比较现有的 qenv 和 within API 如何捕获并验证表达式,以及 get_code 如何渲染它们。检查提议的 add_pipe 工作流及其与 teal_data 的交互。完成标准是:可以追加一个未完成的管道,并在多次调用之间继续它,同时将验证延迟到表达式终止之后。
由索引模型根据 Issue 内容生成。
描述
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
- 派生
- 10
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pharmaverse/teal.data 的其他 Issue
-
question
难度 3/5 半天 新手友好度 62/100
pharmaverse/teal.data#395 ·
-
[Bug]: Can't find join_keys between indirectly linked datasets可能已有人在做 @gogonzo 于 413 天前认领。 未关闭bug core
pharmaverse/teal.data#384 · 已指派 1 人 ·
-
[Bug]: `c` method for teal_data doesn't concatenate `@join_keys`可能已有人在做 @chenyangsu 于 7 天前认领。 未关闭bug core
难度 3/5 1-2 天 新手友好度 45/100
pharmaverse/teal.data#374 ·
-
core enhancement
难度 5/5 一周以上 新手友好度 20/100
pharmaverse/teal.data#368 · 4 条评论 ·
-
bug core
难度 4/5 3-5 天 新手友好度 25/100
pharmaverse/teal.data#351 · 3 条评论 ·
查看 pharmaverse/teal.data 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
Bioconductor/BiocParallel#289 ·
-
automation
难度 2/5 1-3 小时 新手友好度 68/100
waldronlab/BugSigDBcuration#2224 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
merliseclyde/BAS#118 ·