r - 将参数传递给 R 环境中的函数,(gWidget)
问题描述
我有一个数据表列表:
PID_short PID_full
420 44101445
419 44101375
418 44101344
417 44100125
... ...
3 44054648
2 68049258
1 68051786
这是我的代码:
require(gWidgets)
w <- gwindow("bigfoot")
g <- ggroup(cont = w, horizontal = FALSE)
g1 <- ggroup(cont = w)
g2 <- ggroup(cont = w)
Vl <- list ()
fr3 <- gframe ("", cont=g, horizontal=TRUE)
l3 <- glayout ( cont = fr3 , expand=TRUE)
l3 [1,1] <- NbS <- glabel("PID_short", cont = l3)
l3 [1,2] <- (Vl$NbS <- gcombobox ((c(1:420)), cont = l3))
ok <- gbutton("OK", cont = g, handler=rbC)
fr4 <- gframe ("", cont=g, horizontal=FALSE)
l4 <- glayout (cont=fr4, expand = TRUE)
l4 [1,1] <- Dm <- glabel("PID_full", cont = l4)
l4 [1,2] <- (Vl$Dm <- gedit("", cont = l4))
好的,我希望当我420
在 gcombobox 中选择并按下ok
时,PID_full
会告诉我44101445
,就像在表格中一样,等等。
但是我不知道如何将参数传递给函数,因为我实际上是 R 的新手。有人可以帮助我吗?我希望我提供了一个明确的信息......如果有任何不清楚的地方,我会更新它,非常感谢,将不胜感激。
解决方案
推荐阅读
- python - 如何使用内联 for 循环替换子字符串?
- asp.net-core - Blazor Wasm PWA 未更新
- arrays - 使 fscanf 以某种格式扫描文本直到行尾
- python - 在 python pandas 中打开 json l 后如何跨字段聚合
- django - Docker 无法识别 Dockerfile
- reactjs - 如何让 Google 的网络爬虫访问引导主题?
- reactjs - Ant Design:使用表单进行输入验证
- sql - 查找 B 列中与 A 列中特定值相对应的所有值 ORACLE SQL
- javascript - Auth0 axios.post 与令牌内部服务器错误 500
- html - Ajax 无法处理 POST 表单提交,而是使用默认 POST