Skip to content

Instantly share code, notes, and snippets.

@jrosen48
Created February 14, 2020 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrosen48/a0056718e279e9e1c5d3e87772b3d89a to your computer and use it in GitHub Desktop.
Save jrosen48/a0056718e279e9e1c5d3e87772b3d89a to your computer and use it in GitHub Desktop.
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
library(readr)
library(dplyr)
d <- read_rds("mx.rds")
n_row <- d %>%
count(id_string) %>%
nrow()
# Define UI for application that draws a histogram
ui <- fluidPage(
# Application title
titlePanel("Thread Viewer"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
numericInput("thread_number",
"Thread Number:",
min = 1,
max = n_row,
value = 1)
),
# Show a plot of the generated distribution
mainPanel(
DT::dataTableOutput("datatable")
)
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
output$datatable <- DT::renderDataTable({
dd <- d %>%
filter(id_string == input$thread_number) %>%
arrange(created_at)
dd
})
}
# Run the application
shinyApp(ui = ui, server = server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment