This function is called by the resp_shape module and loads a shapefile into an sf object. Inspired by a function written by Paula Moraga here: https://www.paulamoraga.com/book-geospatial/sec-shinyexample.html#uploading-data

resp_shape(shpdf, logger = NULL)

Arguments

shpdf

dataframe. As produced by shiny::fileInput, containing name and datapath columns

logger

Stores all notification messages to be displayed in the Log Window. Insert the logger reactive list here for running in shiny, otherwise leave the default NULL

Value

an sf object

Author

Simon Smart simon.smart@cantab.net

Paula Moraga

Examples

shpdf <- data.frame(
datapath = list.files(system.file("extdata", "shapes", package = "disagapp"), full.names = TRUE),
name = list.files(system.file("extdata", "shapes", package = "disagapp")))
shape <- resp_shape(shpdf)