Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R selectInput()中的输入ID不刷新结果_R_Shiny - Fatal编程技术网

R selectInput()中的输入ID不刷新结果

R selectInput()中的输入ID不刷新结果,r,shiny,R,Shiny,我试图在ui.R中输入组织名称,如下所示- selectInput("Organization", "Enter an Org:", choices = c("Blenheim Palace", "Chatsworth", "Gloucester Cathedral", "Manchester Cathedral", "Royal Albert Hall", "StPauls Cathedral")) OrganizationInput <- reactive({switch(input

我试图在ui.R中输入组织名称,如下所示-

selectInput("Organization", "Enter an Org:", choices = c("Blenheim Palace", "Chatsworth", "Gloucester Cathedral", "Manchester Cathedral", "Royal Albert Hall", "StPauls Cathedral"))
OrganizationInput <- reactive({switch(input$Organization, "Blenheim Palace" = Blenheim_Palace, "Chatsworth" = Chatsworth, "Gloucester Cathedral" = Gloucester_Cathedral, "Manchester Cathedral" = Manchester_Cathedral, "Royal Albert Hall" = Royal_Albert_Hall, "StPauls Cathedral" = StPauls_Cathedral)}) 

rawData <- reactive(function(){
    some_txt <- sqlQuery(dbhandle, 'SELECT REVIEW_COMMENTS FROM XXXXXX.tripadvisor_data where brand_name = "OrganizationInput()"')
    some_txt <- data.frame(some_txt)
我尝试使用此输入刷新我的wordcloud。基本上,当我选择一个组织时,比如说布伦海姆宫,wordcloud应该随着tripadvisor.com上对该组织的评论而改变。 我的
server.R
代码如下-

selectInput("Organization", "Enter an Org:", choices = c("Blenheim Palace", "Chatsworth", "Gloucester Cathedral", "Manchester Cathedral", "Royal Albert Hall", "StPauls Cathedral"))
OrganizationInput <- reactive({switch(input$Organization, "Blenheim Palace" = Blenheim_Palace, "Chatsworth" = Chatsworth, "Gloucester Cathedral" = Gloucester_Cathedral, "Manchester Cathedral" = Manchester_Cathedral, "Royal Albert Hall" = Royal_Albert_Hall, "StPauls Cathedral" = StPauls_Cathedral)}) 

rawData <- reactive(function(){
    some_txt <- sqlQuery(dbhandle, 'SELECT REVIEW_COMMENTS FROM XXXXXX.tripadvisor_data where brand_name = "OrganizationInput()"')
    some_txt <- data.frame(some_txt)

OrganizationInput如果希望
OrganizationInput
成为字符串,是否需要在开关a la中引用值:

OrganizationInput <- reactive({switch(input$Organization, "Blenheim Palace" = "Blenheim_Palace", "Chatsworth" = "Chatsworth", ...

OrganizationInput这本质上是在sqlQuery()中参数化输入$Organization的问题。我使用了来自

它成功了。谢谢你调查我的问题