【发布时间】:2018-05-12 05:05:27
【问题描述】:
我正在开发两个 Shiny 应用程序,我希望能够使用应用程序 1 为应用程序 2 生成一些输入(在本例中为基因名称)。来自 App 1 的基因名称通过 shiny 的 parseQueryString() 解析,然后对 App 2 执行任何操作。
为了模拟 App 1,我只有一个简单的 HTML 文件(我从this webinar about bookmarking 获得了链接结构):
<html>
<body>
<div>
<a href="http://10.59.24.60:3800/quux/?_inputs_&gene=IL23R">Send to targetProfiler</a>
</div>
</body>
</html>
其中“quux”是 App 2 的名称。这非常好;我单击链接并被带到 App 2,然后它在数据库中搜索基因名称等。但是,我在右下角收到 shiny 错误消息
其中读取shiny 认为它未能解析 URL 参数,而实际上它确实解析了。
处理这个的服务器代码是这样设置的:
observe({
#make sure its first time loading app
if (!vals$firstLoad) {
return (NULL)
}
query <- parseQueryString(session$clientData$url_search)
# browser()
# Only continues when there is gene names to be queried in the URL
req(query[['gene']])
# Get URL parameter
inputText <- paste0(unique(splitByComma(query[['gene']])), collapse = ',') # Only unique terms
#do stuff with inputText
#...
#...
有没有办法抑制这个警告/错误?或者shiny 认为它没有正确解析 URL 参数,而实际上它有什么做错了?
【问题讨论】: