I am looking for a tutorial on how to feed a dataframe with data imported into a shiny app. My main goal is to filter csv data from widgets. At the end they will have to be displayed on a geojson map background (I don't know how I'm going to do it yet). What is the best way to filter the data from my uploaded csv?
Name; meta1; meta2; meta3; date_start; date_end; value1; value2 are assumed to be in the header.
As an example, I would like to keep name, value1 and meta2 data for certain dates (date_start to date_end).
With regards
In the server part, here is my starting point for loading the csv:
The output$contents are rendered using the renderTable function.
inFile - the input file
Then (is.null(inFile))
return(NULL)
read.csv(inFile$datapath, header = input$header)
})
this is less of a shiny question and more of a data wrangling issue. In server.R
you can read the csv before you declare shinyServer
to make that data available. Then the usual tutorials in shiny will be fine. If you are new, I would recommend tidyverse set of packages for wrangling data. Particularly for your needs, dplyr
for filtering and lubridate
for working with dates would be a good start.
For GeoJSON, I work with that a lot but unfortunately not in R; I'm usually doing this in javascript. However, I'm sure there are some packages to work with Google Maps, mapbox, etc, that work with geojson data easily. Maybe someone else can give a good recommendation.
This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.