大佬教程收集整理的这篇文章主要介绍了警告:使用服务器端选择来大幅提高 RShiny 的性能,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在 RShiny 应用程序中,我收到警告消息 Warning message: The SELEct input "the_input_ID" contains a large number of options; consIDer using server-sIDe SELEctize for massively improved perfoRMANce. See the Details section of the ?SELEctizeinput Help topic.
我有一个长度 == 3000 的命名向量 nameList 用于下拉选项。我已经尝试了以下两件事来摆脱这个警告:
用户界面
SELEctizeinput(
inputID = 'the_input_ID',label = 'Player 1 Search:',choices = nameList,SELEcted = NulL,options = List(placeholder = 'Please SELEct an option below',onInitialize = I('function() { this.SETVALue(""); }'))
)
uioutput(outputID = 'this_ID')
服务器
updateSELEctizeinput(session = session,inputID = 'the_input_ID',server = TRUE,onInitialize = I('function() { this.SETVALue(""); }')),SELEcted = ""
)
output$this_ID<-renderUI ({
SELEctizeinput(inputID = 'this_ID',"Player 2 Search:",nameList,options = List(
placeholder = 'Please SELEct an option below',onInitialize = I('function() { this.SETVALue(""); }')
))
})
the_input_ID 的方法是在 UI 中使用 SELEctizeinput(),在服务器中使用 updateSELEctizeinput()(我认为这是服务器端选择的正确方法)。 this_ID 的方法是在 UI 中使用 uioutput(),在服务器上使用 renderUI + SELEctizeinput。这两种方法都给出了我在上面发布的相同警告消息。如何解决此问题/以消除此警告消息。
我认为问题在于您仍在使用 choices = namelist
在 UI 中生成选项列表。
尝试改用 choices = NULL
。
要使其正常工作,请按照“服务器端选择”of this guide 部分中的示例进行操作。
以上是大佬教程为你收集整理的警告:使用服务器端选择来大幅提高 RShiny 的性能全部内容,希望文章能够帮你解决警告:使用服务器端选择来大幅提高 RShiny 的性能所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。