Dear All,

I am trying to run simple code:


*UI.R*

library(shiny)

shinyUI(fluidPage(


  titlePanel("Old Faithful Geyser Data"),

  sidebarLayout(
    sidebarPanel(
      selectInput("gb","gb",names(data))
      ,
      selectInput("var","var",names(data))
      ),

    # Show a plot of the generated distribution
    mainPanel(
      plotOutput("distPlot")
    )
  )
))


*SERVER.R *

library(shiny)
library(ggplot2)
library(dplyr)
library(testthat)
load("/home/void/PISA/data.rda")
shinyServer(function(input, output) {


  output$distPlot <- renderPlot({
    df1<-group_by(data,input$gb)
    df2<-summarise(df1,ov=mean(input$var,na.rm=T))
    hist(df2[,"ov"])
  })
})

but I've  received an error:

Listening on http://127.0.0.1:6721

Warning in mean.default("CNT", na.rm = T) :

  argument is not numeric or logical: returning NA

Error in hist.default(df2[, "ov"]) : invalid number of 'breaks'

Warning in mean.default("PV4MATH", na.rm = T) :

  argument is not numeric or logical: returning NA

Error in hist.default(df2[, "ov"]) : invalid number of 'breaks'


I've checked that input$gb and input$var returns "CNT"... but dplyr expects
CNT...

Do you have any idea how to deal with this problem?

Thanks,
D

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to