hand_compass: Sketchy compass with 'handwritten' font

Description Usage Arguments Value Examples

Description

Adds a compass (very crude) to a hand drawn map.

Usage

1
2
hand_compass <- function (x, y, r, rot = 0, cex = 1, north_name =  "N", fontfam='am', overdraw=FALSE, ...) 
x %>% hand_compass(...)

Arguments

x

x-coordinate for compass centre

y

y-coordinate for compass centre

r

compass 'radius' in map units

rot

compass rotation

cex

compass scale

north_name

Name for north to write on the compass

fontfam

Handwritten font family - see get_fonts

overdraw

whether to use overdraw when drawing compass lines

...

other parameters passed on to the sketch_it function

Value

No value returned

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Here make_canvas is inserted in a pipeline after a simplified and tidied 
# map of Irish NUTS3 regions is created.  A sketchy rendition is then added to the
# canvas.
get_fonts()
data(RA) 
RA.spdf %>% small_chop %>% gSimplify(tol=11000) %>% tidy_it %>% clone_data(RA.spdf) -> RA.spdf2
shadecol <- ifelse(RA.spdf2$NUTS2 == 'IE01','indianred','dodgerblue')

RA.spdf2 %>% make_canvas %>% sketch_it(col=shadecol)
# Add a north arrow with 'North' written in Irish
hand_compass(353685,424980,30000,fontfam = 'pm',north_name="รณ thuaidh")

chrisbrunsdon/caricRture documentation built on May 13, 2019, 6:52 p.m.