knitr::opts_chunk$set(echo=TRUE,error=TRUE) knitr::opts_chunk$set(comment = "") library("sdam")
options(width = 96)
Install and load a version of "sdam"
package.
install.packages("sdam") # from CRAN devtools::install_github("sdam-au/sdam") # development version devtools::install_github("mplex/cedhar", subdir="pkg/sdam") # legacy version R 3.6.x
# load and check versions library(sdam) packageVersion("sdam")
Cartographical maps of Roman provinces under Emperors Trajan and Hadrian (year 117AD), and Italian regions
under Emperor Augustus (year 27 BC) are part of the suite of datasets of the "sdam"
package.
For instance, four cartographical maps related to the Roman Empire in the antiquity period are available in
dataset "retn"
that is loaded by function plot.map()
to depict cartographical maps and transportation systems.
plot.map()
is an interface that also invokes datasets "rpmp"
for names and vector shapes of Roman provinces and
regions, and dataset "rpmcd"
for including map captions and dates in the plot.
Plotting political divisions of the Roman Empire needs the 'type'
argument of function plot.map()
as well.
plot.map()
are in dataset "rpmp"
,
while the acronyms in x
are as in dataset "rp"
. A plain
cartographical map with a Roman transportation system made of settlements and terrestrial and maritime routes
is possible with the type
argument in plot.map()
, or else by specifying with arguments
settl
, roads
, and shipr
for the settlements and this routes in the transportation system.
Graph representations of the transport network is possible with packages "multigraph"
and
"multiplex"
.
Access to the shipwrecks dataset.
# shipwrecks dataset sw <- system.file("extdata","StraussShipwrecks.csv",package="sdam") |> read.csv(sep=";")
# variables are checked colnames(sw)
A system of maritime routes is found in variables Place.of.origin
and Place.of.destination
,
which correspond to columns 20 to 21 in sw
.
This edge list needs some transformations with functions from packages "sdam"
and "multiplex"
to be able to plot the shipwrecks network as a directed graph with loops with a force directed layout.
# graph of shipwrecks network sw[, 20:21] |> sdam::cln(level=2, what=c("(",")"), case=1, na.rm=TRUE) |> multiplex::transf(type="toarray") |> multigraph::multigraph(layout="force", seed=123, loops=TRUE, ecol=4, sel="Rome")
In this case, a single node is labeled in the graph that represents the shipwrecks network without missing information.
To keep records with NA
in the data, function cln()
has the 'na.rm'
argument to be set to FALSE
.
References for shipwrecks data are in
"sdam"
package ¨
"sdam"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.