Utilice el ingreso de texto brillante y dplyr para filtrar filas en un marco de datos

Estoy tratando de usar el widget de entrada de texto en una aplicación brillante para filtrar filas en un marco de datos, pero no puedo hacerlo funcionar.

Conjunto de datos

df1<-data.frame (Name=c("Carlos","Pete","Carlos","Carlos","Carlos","Pete","Pete","Pete","Pete","Homer"),Sales=(as.integer(c("3","4","7","6","4","9","1","2","1","9"))))

UI

shinyUI(fluidPage(
titlePanel("Sales trends"),titlePanel("People score"),

sidebarLayout(sidebarPanel(

  textInput("text", label = h3("Text input"), value = "Enter text..."),

  numericInput("obs", "Number of observations to view:", 3),

  helpText("Note: while the data view will show only the specified",
           "number of observations, the summary will still be based",
           "on the full dataset."),

  submitButton("Update View")
),

mainPanel(
  h4("Volume: Total sales"),
  verbatimTextOutput("volume"),

  h4("Top people"),
  tableOutput("view")
))))

Servidor

library(shiny)
library (dplyr)
df1<-data.frame (Name=c("Carlos","Pete","Carlos","Carlos","Carlos","Pete","Pete","Pete","Pete","Homer"),Sales=(as.integer(c("3","4","7","6","4","9","1","2","1","9"))))
shinyServer(function(input, output) {
output$value <- renderPrint({ input$text })
datasetInput <- reactive({
switch(input$dataset,df1%>% filter(Name %in% "input$text")%>% select(Name, Sales)%>% arrange(desc(Sales)))
})
output$volume <- renderPrint({
dataset <- datasetInput()
sum(dataset$Sales)
})})

Respuestas a la pregunta(1)

Su respuesta a la pregunta