I'm trying to create an app that allows users to upload data and then use the data in a histogram. But I'm having trouble getting the data table to display for users, and then using a specific column within the dataset to manipulate the histogram. Here's the code I have so far:
library(shiny)
ui <- fluidPage(
titlePanel("HD App"),
sidebarLayout(
sidebarPanel(
fileInput("file1", "Choose a File",
accept = c(".txt",
".tsv"),
buttonLabel = "Browse...",
placeholder = "No file selected"),
sliderInput(inputId = "num",
label = "Subset Data",
value = 1500, min = 1, max =3000),
actionButton("reset", "Reset")
),
mainPanel(
DT::dataTableOutput("contents"),
plotOutput("hist")
))
)
So I've figured out how to upload the data so far (it's a .txt file of a data table). But I want to render the data using DT::dataTableOutput
, but I haven't been able to figure it out so far. I also want to make a histogram, that changes based on the frequency of the first column in the data table (the first column is weight).