R/mpattern.R

Defines functions mpattern

Documented in mpattern

#' mpattern
#'
#' Creates a visualization of point pattern data over a shapefile.
#'
#' @import ggplot2
#' @export


mpattern = function(shapefile,longitude = longitude, latitude = latitude,  title = NULL, pcolor = 'black', psize=.95){
    # Point pattern map
    shapefile.sf = as(shapefile, "sf")

    ggplot2::ggplot() +
    ggplot2::geom_sf(data = shapefile.sf, fill = "#e5e5e5", col = "black") +
    ggplot2::geom_point(ggplot2::aes(x = longitude, y = latitude), size= psize, col = pcolor)+
    ggplot2::labs(title = title, x = 'Longitude', y = 'Latitude') +
    theme_qspatial()

}
qspatialR/qspatial documentation built on April 30, 2020, 6:55 a.m.