具有X轴和Y轴选择输入的闪亮和rCharts/Polycharts

具有X轴和Y轴选择输入的闪亮和rCharts/Polycharts,r,shiny,rcharts,polychart,R,Shiny,Rcharts,Polychart,我有一个问题,我导入一个大的数据集,然后从该数据集生成一些选择输入,然后希望能够有一个绘图,我可以从数据集中自由选择我的x轴和y轴 我一直在用我当前的代码破坏浏览器-我相信这与rCharts试图生成polychart有些关系,变量还不可用-我的自定义输入必须首先加载。我尝试过使用反应部分和隔离输出,以及其他东西——要么我做得不正确,要么这不是正确的方法——无论哪种方法都不起作用 我对Shinny,R,尤其是rCharts比较陌生,但我的图形只使用一个输入-当尝试选择多个输入时会出现问题 我有以下

我有一个问题,我导入一个大的数据集,然后从该数据集生成一些选择输入,然后希望能够有一个绘图,我可以从数据集中自由选择我的x轴和y轴

我一直在用我当前的代码破坏浏览器-我相信这与rCharts试图生成polychart有些关系,变量还不可用-我的自定义输入必须首先加载。我尝试过使用反应部分和隔离输出,以及其他东西——要么我做得不正确,要么这不是正确的方法——无论哪种方法都不起作用

我对Shinny,R,尤其是rCharts比较陌生,但我的图形只使用一个输入-当尝试选择多个输入时会出现问题

我有以下三个UI为renderCharts提供输入,如下所示:

    output$TestSelection <- renderUI({
          selectInput("TestSel", "Test Variable", ls(df, pattern = ".*?_meas|.*?_calc"))
    })
    output$customx <- renderUI({
          selectInput("xcustom", "Custom Graph - X", ls(df), selected = input$TestSel) 
    }) 
    output$customy <- renderUI({
         selectInput("ycustom", "Custom Graph - Y", ls(df), selected = input$TestSel) 
    }) 
output$TestSelection
   output$customplot <- renderChart2({
      if(is.null(input$xcustom)|is.null(input$ycustom))
        return(rCharts$new())

      #Removing all unneccessary data from dataframe,
      dataPlot <- df[,c("DUT", input$ycustom, input$xcustom)]

      custom_chart <- rPlot(x = input$xcustom,y = input$ycustom,
                            data = dataPlot, 
                            type = "point", 
                            tooltip = "#!function(item){return item.DUT}!#", 
                            sample = FALSE)

      #Adjusting width to fit the current screen
      custom_chart$set(width = session$clientData$output_plot2_width , title = paste(input$ycustom, " vs. ", input$ycustom, sep =""))

      #Setting the correct axis
      axisincrease = abs((max(dataPlot[,input$xcustom])-min(dataPlot[,input$xcustom]))*0.05)

      custom_chart$guides(
       x = list(
          min = pretty(dataPlot[,input$xcustom])[1]-axisincrease,
          max = tail(pretty(dataPlot[,input$xcustom]),1)+axisincrease,
          numticks = length(dataPlot[,input$xcustom])
        ),
       y = list(
          min = pretty( dataPlot[, input$ycustom] ) [1],
          max = tail( pretty( dataPlot[, input$ycustom] ), 1 )
       )
       )
       return(custom_chart)})