#' This function imports a shapefile from a postgreSQL database.
#' @export
#' @title Import a shapefile from a postgreSQL database
#' @name getShape
#' @param con An object of class "pgConnect" generated by pgConnect()
#' @param vecTable Name of vectorial table in the database
#' @return Spatial object of class 'sp'
#' @author Bruno Silva
getShape <- function(con, vecTable){
shape <- rgdal::readOGR(dsn = con[[2]], vecTable)
return(shape)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.