Giter Club home page Giter Club logo

sdam-au / sdam Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 112.46 MB

Provides digital tools for performing analyses within Social Dynamics and complexity in the Ancient Mediterranean (SDAM), which is a research group based at the Department of History and Classical Studies at Aarhus University.

Home Page: https://CRAN.R-project.org/package=sdam

License: Creative Commons Attribution 4.0 International

R 100.00%
digital-humanities dataset inscriptions extract aarhus-university cartography data-visualization encoding r rest-api temporal

sdam's Introduction

sdam

Social Dynamics and Complexity in the Ancient Mediterranean

Provides digital tools for performing analyses within Social Dynamics and complexity in the Ancient Mediterranean (SDAM), which is a research group based at the Department of History and Classical Studies at Aarhus University.


Installation

Install sdam package from CRAN or a GitHub repository.

## from CRAN
install.packages("sdam")
## development version
devtools::install_github("sdam-au/sdam")

or

## legacy version R-3.6.x
devtools::install_github("mplex/cedhar", subdir="pkg/sdam")

Usage

## Load package
library("sdam")
packageVersion("sdam")
#[1] '1.1.1'
## Load epigraphic data
data("EDH")
# Look at how many inscriptions?
length(EDH)
# [1] 84701
# Also look at the object structure
str(EDH)

Get particular inscriptions

Starting with sdam v0.8.0, it is possible to extract inscriptions from the new API of the EDH database. For instance, the following commands extract people named in Roman inscriptions in Iudaea and record them with a list data object in iud.

# obtain epigraphic data from Iudaea
iud <- get.edh(search="inscriptions", province="Iud")
# how many inscriptions in Iudaea?
length(iud)
# [1] 187

Relative dating

In sdam there is the option to extract variables from a EDH dataset fragments with function edhw(), which allos making transformations as weel. For instance, te ode snippet below is to place Roman inscriptions in lists from Iudaea into a data frame in object iud_df.

# extract variables of interes from object `iud` and convert it into a data frame
iud_df <- edhw(x=iud, vars=c("not_after", "not_before"), as="df", na.rm=FALSE)

# what object types is?
is(iud_df)
#[1] "data.frame" "list"       "oldClass"   "vector"  

To remove missing data form iud_df, we activate na.rm argument in the function as for iud_df0

# extract variables of interes from object `iud` and convert it into a data frame
iud_df0 <- edhw(x=iud, vars=c("not_after", "not_before"), as="df", na.rm=TRUE)

Now we compare outcomes with these two options.

cbind(head(iud_df,10), head(iud_df0,10))
#         id not_before not_after       id not_before not_after
#1  HD001461       0071      0130 HD001461       0071      0130
#2  HD001958       0301      0400 HD001958       0301      0400
#3  HD001964       0132      0135 HD001964       0132      0135
#4  HD001973       0071      0130 HD001973       0071      0130
#5  HD001985       0198      0209 HD001985       0198      0209
#6  HD002376       0051      0220 HD002376       0051      0220
#7  HD004074       0026      0036 HD004074       0026      0036
#8  HD004735       0070      0079 HD004735       0070      0079
#9  HD006228       0212      0220 HD006228       0212      0220
#10 HD007068       <NA>      <NA> HD011646       0117      0138

Hence, not available data is removed in iud_df0.

People

It is possible to extract the people component from the EDH API dataset, which is an integrated list with their own items.

For instance, the following commands extract people named in Roman inscriptions in Iudaea and Syria into a data frame object with a long (default) and a data frame with a wide format:

edhw(x=get.edh(search="inscriptions", province="Iud"), vars="people", as="df")
edhw(x=get.edh(search="inscriptions", province="Syr"), vars="people", as="df", wide=TRUE)

The same can apply to the rest of Roman provinces recorded in the EDH dataset.

Specifying output

It is also possible to limit the amount of records to process, and with the following example we can extract the first four inscriptions by hd_nr id in a data frame with a long format.

edhw(vars="people", as="df", limit=4)
#        id age: years             cognomen gender                                              name    nomen person_id praenomen           status   tribus
#1 HD000001       <NA>               Optata female                               Noniae P.f. Optatae    Nonia         1      <NA>             <NA>     <NA>
#2 HD000001       <NA>               Artemo   male                                 C. Iulio Artemoni   Iulius         2        C.             <NA>     <NA>
#3 HD000001       <NA>              Optatus   male                            C. Iulius C.f. Optatus   Iulius         3        C.             <NA>     <NA>
#4 HD000002         70                Paris   male                                  C. Sextius Paris  Sextius         1        C.             <NA>     <NA>
#5 HD000003       <NA> Sisenna+ Rutilianus+   male      [P. M]ummio [P.f. Gal. S]isenna[e Rutiliano] Mummius+         1       P.+ senatorial order Galeria+
#6 HD000004       <NA>                [---]   <NA> [---?]AV(?)S(?)[---]L(?)L(?)A M. Porci Nigri ser.     <NA>         1      <NA>           slaves     <NA>
#7 HD000004       <NA>                Niger   <NA>                                    M. Porci Nigri  Porcius         2        M.             <NA>     <NA>

while a specific record is retrieved by using the id argument as follows:

edhw(vars="people", as="df", id=4444)
#        id     cognomen gender                   name    nomen person_id praenomen           status
#1 HD004444    Gordianus   male     M. Antoni Gordiani Antonius         1        M.             <NA>
#2 HD004444 Tranquillina female Sabiniae Tranquillinae  Sabinia         2      <NA>             <NA>
#3 HD004444  Mercurialis   male       Iul. Mercurialis  Iulius*         3      <NA> equestrian order

Probability of existence

Since sdam v0.3.0 there is a dedicated function to compute probability of existence of date points or intervals. We obtain inscriptions from Iudaea in EDH data base, and then compute the aoristic sum with a 5-bin chronological phases.

prex(x=get.edh(search="inscriptions", province="Iud"), vars=c("not_before", "not_after"), cp="bin5")
#   Arch     Class      Hell       Rom       Byz 
#    0.000     0.000  1337.904 13405.017     0.000

Since most of the inscriptions are within the Roman period, we try an eight-bin chronological phases option.

prex(x=get.edh(search="inscriptions", province="Iud"), vars=c("not_before", "not_after"), cp="bin8")
#   Arch     Class      Hell      ERom      MRom      LRom      EByz      LByz 
#   0.0000    0.0000 1337.9040 2396.4529 1200.5623  320.5379    0.0000    0.0000

Vignettes

See also

sdam's People

Contributors

mplex avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sdam's Issues

Funtion edhw() supports several provinces

Function edhw() of "sdam", legacy version 1.1.7, now accepts several Roman province for retrieving inscriptions from the EDH dataset at https://github.com/mplex/cedhar/tree/master/pkg/sdam

# install legacy version
devtools::install_github("mplex/cedhar", subdir="pkg/sdam")
# obtain tribes from the two Germania provinces
sdam::edhw(province=c("GeI","GeS")) |> 
  sdam::edhw(vars="people") |> 
  getElement("tribus") |> 
  unlist(use.names=FALSE) |> 
  unique()

Also a bug is fixed when trying to obtain records by ids without specifying variables for a data frame output.

# two EDH records by 'id' as data frame with all variables
sdam::edhw(id=c("HD082382","HD082381"), as="df")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.