Skip to content

Commit

Permalink
version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ authored and cran-robot committed Sep 27, 2022
0 parents commit ce8a796
Show file tree
Hide file tree
Showing 13 changed files with 215 additions and 0 deletions.
18 changes: 18 additions & 0 deletions DESCRIPTION
@@ -0,0 +1,18 @@
Package: dogesr
Type: Package
Title: Work with the Doges/Dogaresse Dataset
Version: 0.1.0
Author: Juan Julián Merelo-Guervós
Maintainer: Juan Julián Merelo-Guervós <jjmerelo@gmail.com>
Description: Work with data on Venetian doges and dogaresse, and use it for social network analysis.
License: GPL-3
Encoding: UTF-8
LazyData: true
Depends: R (>= 3.5.0)
Suggests: testthat (>= 3.0.0)
Config/testthat/edition: 3
Imports: dplyr
NeedsCompilation: no
Packaged: 2022-09-26 16:35:14 UTC; jmerelo
Repository: CRAN
Date/Publication: 2022-09-27 08:30:02 UTC
12 changes: 12 additions & 0 deletions MD5
@@ -0,0 +1,12 @@
d749998e0b1f57b38dba9c81c642edcc *DESCRIPTION
1c68ff93524f272396ed94c64cfe20d1 *NAMESPACE
a0aa0b9927703fafcbb2eca5db2ded16 *NEWS.md
5ca494860f345762e5ca20ebc046b926 *R/doges.R
bf04be5f4d1327728a73a8c81f1c13e1 *R/doges.years.R
bdff3413d32abc8a96b256c7a060bd45 *README.md
9f77734c46256952bdb7df6102c7af68 *data/doges.rda
44471a63140de5bb20f19ba9be381847 *man/doges.Rd
4c56996ed3339da8838989af04b14a44 *man/doges.years.Rd
1d971f3ebe61e9a030d862e2a0eb2c63 *tests/testthat.R
a1349a689fa58d8c3b08e4c6ceb699e5 *tests/testthat/test-dogesdata.R
1c7c606abf4483566e42485c77687f41 *tests/testthat/test-dogesyearsdata.R
2 changes: 2 additions & 0 deletions NAMESPACE
@@ -0,0 +1,2 @@
exportPattern("^[[:alpha:]]+")
import(dplyr)
12 changes: 12 additions & 0 deletions NEWS.md
@@ -0,0 +1,12 @@
## version 0.1.0

First version including `data.doges` and `doges.years`

---



### NEWS.md setup

- added NEWS.md creation with newsmd

6 changes: 6 additions & 0 deletions R/doges.R
@@ -0,0 +1,6 @@
# @doctype data
# @usage data("doges")
# @format CSV
# @keywords digital humanities, history, republic of Venice

"doges"
18 changes: 18 additions & 0 deletions R/doges.years.R
@@ -0,0 +1,18 @@
globalVariables(c("data.doges"))
library(dplyr)

#' Extract just the information needed to work with the years every doge was ruling
#'
#' @return A data frame with the data for every doge, years reigning, century, family.
#' @export
#'
#

doges.years <- function() {
data.doges.years <- data.doges
data.doges.years$Doge.raw <- NULL
data.doges.years$Dogaressa.raw <- NULL
data.doges.years$Dogaressa <- NULL
data.doges.years$Family.dogaressa <- NULL
return(distinct(data.doges.years))
}
22 changes: 22 additions & 0 deletions README.md
@@ -0,0 +1,22 @@
<!-- badges: start -->
[![Test package](https://github.com/JJ/dogesr/actions/workflows/R-stuff.yml/badge.svg)](https://github.com/JJ/dogesr/actions/workflows/R-stuff.yml)
<!-- badges: end -->

# dogesR

Module (with data) to work with the dogi and dogaresse of the Venetian republic. Main intention is to analyze social networks resulting from marriages and other interactions.

It grew from the data used in this paper; please cite it if you are using this module:

```
@misc{https://doi.org/10.48550/arxiv.2209.07334,
doi = {10.48550/ARXIV.2209.07334},
url = {https://arxiv.org/abs/2209.07334},
author = {Merelo-Guervós, J. J.},
keywords = {Social and Information Networks (cs.SI), Computers and Society (cs.CY), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {What is a good doge? Analyzing the patrician social network of the Republic of Venice},
publisher = {arXiv},
year = {2022},
copyright = {Creative Commons Attribution Share Alike 4.0 International}
}
```
Binary file added data/doges.rda
Binary file not shown.
34 changes: 34 additions & 0 deletions man/doges.Rd
@@ -0,0 +1,34 @@
\name{data.doges}
\alias{data.doges}
\title{Load data into the environment}
\usage{
data("doges")
}
\description{
Load data.doges into the environment
}

\value{
A dataframe with a row for every doge and doge marriage, and the columns
\itemize{
\item \code{Doge} Full name of the doge.
\item \code{Dogaressa} Full name of the dogaressa (wife of the doge).
\item \code{Doge.raw} Full entry copied from the Wikipedia, original format; includes years of rule.
\item \code{Dogaressa.raw} Full entry copied from the Wikipedia, original format. Years of marriage are include when known; in other cases, they are simply the same as the years of ruling.
\item \code{Century, Start, End, Years } Century where the ofice of the doge took place, years it started and ended, and how many years it lasted, parsed from \code{Doge.raw}.
\item \code{Family.doge, Family.dogaressa} Normalized names of the patrician family the doge and dogaressa belonged. The second is null if it was not a patrician family (usual in the first centuries).
}
}

\examples{
library(dogesr)
data("doges")
# A summary of the duration of the doges ruling
summary(data.doges$Years)

# The families that actually "made doge"
unique(data.doges$Family.doge)

# Families that had either doge or dogaresse
unique( c(data.doges$Family.doge,data.doges$Family.dogaressa))
}
65 changes: 65 additions & 0 deletions man/doges.years.Rd
@@ -0,0 +1,65 @@
\name{doges.years}
\alias{doges.years}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Sub-dataset with years they were ruling.
}
\description{
Create a sub-dataset with doge data and reigning years.
}
\usage{
doges.years()
}
\details{
Eliminates data from the original dataset \code{doges} referring to dogaresse, and leaves just data for the doges, eliminating also the "raw" column.
}
\value{
A dataframe with the columns \code{Doge, Century, Start, End, Family, Years}
}
\references{
@misc{https://doi.org/10.48550/arxiv.2209.07334,
doi = {10.48550/ARXIV.2209.07334},

url = {https://arxiv.org/abs/2209.07334},

author = {Merelo-Guervós, J. J.},

keywords = {Social and Information Networks (cs.SI), Computers and Society (cs.CY), FOS: Computer and information sciences, FOS: Computer and information sciences},

title = {What is a good doge? Analyzing the patrician social network of the Republic of Venice},

publisher = {arXiv},

year = {2022},

copyright = {Creative Commons Attribution Share Alike 4.0 International}
}

}
\author{
J. J. Merelo
}
\note{
Data originally from the Wikipedia
}

%% ~Make other sections like Warning with \section{Warning }{....} ~

\seealso{
\code{link{doges}}
}
\examples{
library(dogesr)
data.doges.years <- doges.years()
summary(data.doges.years$Years)
}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory (show via RShowDoc("KEYWORDS")):
\keyword{ Venice }
\keyword{ Republica Serenissima }
\keyword{ Digital Humanities}
% Use only one keyword per line.
% For non-standard keywords, use \concept instead of \keyword:
% \concept{ ~cpt1 }
% \concept{ ~cpt2 }
% Use only one concept per line.
12 changes: 12 additions & 0 deletions tests/testthat.R
@@ -0,0 +1,12 @@
# This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/tests.html
# * https://testthat.r-lib.org/reference/test_package.html#special-files

library(testthat)
library(dogesr)

test_check("dogesr")
7 changes: 7 additions & 0 deletions tests/testthat/test-dogesdata.R
@@ -0,0 +1,7 @@
data("doges")
test_that("data is loaded", {
expect_vector(data.doges)
expect_length(data.doges,10)
expect_equal(nrow(data.doges),129)
})
data
7 changes: 7 additions & 0 deletions tests/testthat/test-dogesyearsdata.R
@@ -0,0 +1,7 @@
data.doges.years <- doges.years()
test_that("data doges years is loaded", {
expect_vector(data.doges.years)
expect_length(data.doges.years,6)
expect_equal(nrow(data.doges.years),122)
})

0 comments on commit ce8a796

Please sign in to comment.