我正在自学 Shiny,但我被困在 ggplot2 图上,无法使用反应式 dateRangeInput 作为我的 x 轴。我有几个问题:
Aesthetics must be either length 1 or the same as the data (33108): x, y当我尝试使用 input$date 作为我的 aes(x = input$date...library(shiny)
library(tidyr)
library(ggplot2)
tweets <- read.csv(file.choose())
colnames(tweets)[1] <- "Content"
tweets <- separate(tweets, created_at, c("Date", "Time"), sep = " ")
tweets$Date <-as.Date(tweets$Date, "%m/%d/%Y")
ui <- fluidPage(
dateRangeInput(inputId = "date",
strong("Date Range"),
start = "2009-05-04", end = "2018-02-28",
min = "2009-05-04", max ="2018-02-28" ),
plotOutput("Graph")
)
server <- function(input, output) { …Run Code Online (Sandbox Code Playgroud)