cshp_mult | R Documentation |
Create a sequence of cshapes maps highlighting changes in nation-state independence.
cshp_mult(
dates,
cowcodes,
bb,
jitter_labs = TRUE,
highlight = "#00dada",
lat_grat = round(as.numeric(abs(bb[2] - bb[4])/4)),
long_grat = round(as.numeric(abs(bb[1] - bb[3])/4)),
lab_size = 3
)
dates |
A vector of dates indicating time-steps of interest. Each
element must be formatted with |
cowcodes |
A vector, or list, of Correlates of War numeric country codes
to highlight at each corresponding timestep specified in |
bb |
A bounding box to crop the the global cshapes map. Must be a named
vector of the form |
jitter_labs |
Logical to toggle country label jittering with
|
highlight |
Hex color value for country highlighting. |
lat_grat |
Numeric value for latitudinal graticule spacing. |
long_grat |
Numeric value for longitudinal graticule spacing. |
lab_size |
Numeric value for country label text size. |
The chsp_mult
and plot.chsp_mult
functions are currently
experimental functions that are slated for future improvements to the
interface, automated ease of use, and stability. Despite the testing
procedures in place, they may produce odd results with certain combinations
of dates
, countries (cow_codes
), and bounding boxes (bb
).
A list of ggplot2
plotting devices. Each element corresponds to an
element of dates
.
if(requireNamespace("cshapes")){
dates = c(
as.Date("1989-1-1"),
as.Date("1992-5-1"),
as.Date("1993-5-1"),
as.Date("2006-7-1"),
as.Date("2008-3-1")
)
cow_codes = list(345,
c(344, 346, 349),
343,
341,
347)
bb<-c(xmin=13,ymin=40,xmax=24,ymax=47)
balkans<-cshp_mult(dates = dates, cowcodes = cow_codes, bb = bb,jitter_labs = FALSE)}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.