我有时有一个下拉框,只有一个项目可供选择,但这个项目可能是一个带空格的字符串。我怎样才能在 R 中做到这一点?这是问题所在:
library(tcltk2)
root<-tktoplevel()
v <- tclVar()
d <- tk2combobox(root, textvariable=v)
tkpack(d)
# works
tkconfigure(d, values=c("a string with spaces", "a second string"))
# inserts four items instead of one
tkconfigure(d, values=c("a string with spaces"))
任何提示表示赞赏!