Shiny - mean.default(width) : argument is not numeric or logical: returning NA.

Hello.
I have problem with renderPlot.

server.R
(library(shiny)
library(datasets)
shinyServer(function(input, output) {
formulaText1 <- reactive({
paste(input$var,"$Count")
})
formulaText2 <- reactive({
paste(input$var,"$Generator Name")
})
output$SelectedGraf <- renderPlot(
barplot(as.data.frame(formulaText1()),names.arg = as.vector(formulaText2()),horiz=TRUE,
cex.main=0.9,cex.names=0.55, las = 2,
col=ifelse(as.data.frame(formulaText1()))>=7,"red","gray")

)
}
))
UI.R
(shinyUI(fluidPage(
titlePanel("Test"),

sidebarPanel(
selectInput("var",
label = "Choise report type",
choices = list("All"= "rules_count_table",
"Fail"= "alert_rules",
"Error"= "group_executed"),
selected = "All")),
mainPanel(plotOutput("SelectedGraf")
)
)
))