作者psinqoo (零度空间)
看板R_Language
标题[问题] Shinyapp
时间Thu Dec 11 21:00:55 2014
问题: shinyapp server.r
[问题类型]:
程式谘询
[软体熟悉度]:
使用者(已经有用R 做过不少作品)
[问题叙述]:
我在 ui.r 让使用者能输入 "数字"
在server.r
ui.r 输入後到 server.r 参数 input$num
x1<-"https://www.xxx.xxx/xx/xxx/xxx_数字.html"
(x1<-"https://www.xxx.xxx/xx/xxx/xxx_input$num.html")
这段要怎麽写
例如 ui.r 使用者 输入 1234
x1<-"https://www.xxx.xxx/xx/xxx/xxx_1234.html"
[程式范例]:
张贴能够重现错误的程式码,可以帮助版友更快的帮你解决问题
[关键字]:
shinyapp
选择性,也许未来有用
谢谢各位大大解答
正解
x1<-paste("
https://www.xxx.xxx/xx/xxx/xxx_",input$num,".html",sep="")
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.41.190.66
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/R_Language/M.1418302870.A.1B1.html
→ Wush978: 看不懂你的问题耶。
HI Wush978
这已经是我尽力的表达方式
就是 使用者输入 1234
5678
在server.r
能读到 https://www.xxx.xxx/xx/xxx/xxx_1234.html
https://www.xxx.xxx/xx/xxx/xxx_5678.html
就随着使用者输入 网址部分(字串)能随使用者输入能有所改变
12/11 22:46
2F:→ ty854697: input$num,".html") 12/11 22:49
HI ty854697
我试着用你的方式
X1
https://www.xxx.xxx/xx/xxx/xxx_ 1234 .html
在1234的前後均产生空格
※ 编辑: psinqoo (114.41.190.66), 12/11/2014 23:22:44
3F:推 Carollax: 在paste函数里加上sep="" 12/11 23:27
※ 编辑: psinqoo (114.41.190.66), 12/11/2014 23:33:35
4F:→ obarisk: paste0就没有空格了 12/12 10:35