Description Usage Arguments Value Examples
Takes an sf object and a reference sf object and transports it by scaling, shifting it and rotating it.
1 | transport_sf(sf, ref = sf, scale = 1, shift = c(0, 0), rotate = 0)
|
sf |
The sf object to transport |
ref |
The reference sf object |
scale |
A scaling factor (defaults to 1, meaning no change in scale) |
shift |
Distance to shift (TKTKTK what units is it?) |
rotate |
Radians to rotate the sf object |
An sf object
1 2 3 4 5 6 7 8 9 10 11 | # Transports Puerto Rico off the coast of Georgia, rotate 90 degrees
# made 4 times bigger (original Puerto Rico in red, moved in blue)
library(ggplot2)
ggplot()+
geom_sf(data=ggcart:::lower48)+
geom_sf(data=ggcart:::puerto_rico) +
geom_sf(data=ggcart:::puerto_rico, color = "red")+
geom_sf(data=transport_sf(sf=ggcart:::puerto_rico,
scale=4,
shift = c(-130,90)*10000,
rotate=pi/2), color="blue")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.