Can somebody please check what wrong am I doing particularly with the 'Geographic' & 'Metadata' tabs? The output is blank.
library(shiny)
library(DT)
library(shinyWidgets)
# UI
ui <- fluidPage(
titlePanel("PQDT LIS ETDs"),
tabsetPanel(
tabPanel("About",
tags$h4("This dashboard is the result of the study conducted on LIS ETDs retrieved from PQDT Global database. It has 3 Tabs:"),
tags$ol(
tags$li("Geographical Analysis: It shows choropleth map for the analysis of Location field in the metadata"),
tags$li("Metadata: It shows the number of ETDs for Department, University, and Location fields. Further, it shows the distribution of ETDs over the year and a table for all the titles of the ETDs."),
tags$li("Data: You can download data for a particular University & Department using this tab.")
),
tags$h4("How to Use"),
tags$ul(
tags$li("Go to Settings in your browser and click on Zoom to fit the visualization to your desktop"),
tags$li("Refresh the webpage if the visualization is taking time to load")
),
tags$h4("Data Citation"),
tags$p("Lamba, Manika. (2023). PQDT LIS ETDs (Version 1.0).")
),
tabPanel("Geographic Analysis",
tags$iframe(src = "https://infogram.com/choropleth-map-of-pqdt-global-etds-for-us-states-1921-2020-1h7v4pjelmy84k0?live:showVizHome=no&:embed=true", width="90%", height="4000")
),
tabPanel("Metadata (1921-2020)",
tags$iframe(src = "https://public.tableau.com/views/meta_16613991789930/Dashboard1?::showVizHome=no&:embed=true", width="90%", height="400")
),
tabPanel("University",
sidebarLayout(
sidebarPanel(
selectInput("University", label = 'University:', choices = unique(data$University)),
downloadButton("downloadNormal", label = "Download the data", class = "butt1")
),
mainPanel(
DTOutput('mydata')
)
)
)
)
)
# Server
server <- function(input, output) {
# Load data
data <- read.csv("H:\\My Drive\\Manuscripts - PhD\\Data Paper\\standardised_metadata.csv")
data <- data.frame(data)
dataset <- reactive({
subset(data, University == input$University)
})
output$mydata <- renderDT({
dataset()
})
# Download data for selected University & Department
output$downloadNormal <- downloadHandler(
filename = function() {
"output.csv"
},
content = function(file) {
write.csv(dataset(), file, row.names = FALSE)
}
)
}
# Run the app
shinyApp(ui, server)