knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", messages = FALSE, results = 'hide' )
This package contains convenience functions I have written to help deal with spatial data spread across multiple UTM zones and aggregating raster data to overlapping polygons.
To install the latest release on CRAN:
install.packages("RWmisc")
You can install the latest development version from GitHub with:
library(remotes) install_github("jayrobwilliams/RWmisc")
The functions contained in this package serve to make working with spatial data
on large scale easy, as when carrying out cross-national analyses with spatial
data. The function projectUTM
can project sf
and sp
objects in latitude,
longitude coordinate reference systems, and can even re-project
already-projected objects in other projected coordinate reference systems.
library(sf) library(RWmisc) nc <- st_read(system.file("shape/nc.shp", package="sf")) projectUTM(nc)
The theme_rw
function is the minimalist theme I often use for figure in my
work. While it is useful for standard plots, it is an especially large
improvement over the ggplot2
defaults for maps.
library(ggplot2) ggplot(aes(fill = BIR74), data = nc) + geom_sf() ggplot(aes(fill = BIR74), data = nc) + geom_sf() + theme_rw()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.