Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdb00c2
commit 337f271
Showing
33 changed files
with
1,190 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,49 @@ | ||
6e04fbea60d96929662d726108dd4e21 *DESCRIPTION | ||
c983aa75df1f15c8a7a830fe096c224e *NAMESPACE | ||
d92efb0a4090c7c81fb6898590f9b5ed *NEWS.md | ||
72bf3da7a72ebe1a398e152a10d1d524 *DESCRIPTION | ||
2fffc5ac6f14c8ca4bf72103687c10aa *NAMESPACE | ||
72108faa8562fc119253eafab534c816 *NEWS.md | ||
5ca494860f345762e5ca20ebc046b926 *R/doges.R | ||
f36ed16094b6087ce0479669daab0694 *R/doges.years.R | ||
caa74c35eb1f53d4fd4fd235b8b02b30 *R/families.R | ||
3a1c03bd199b898a984b8de910f92452 *R/marriage.graph.R | ||
ef265897a607ae18c2547f4981f28a6c *README.md | ||
29fe6fd08c57f358097aecf63ff18023 *build/partial.rdb | ||
6d2a9c08ed7c19c3e1dc7d393c2c04d9 *build/vignette.rds | ||
7e95790fa128a88770ca99dac476046f *data/doge.families.rda | ||
0dfdd32a261427efce1497ff43c50bf8 *data/doges.marriages.rda | ||
883614ca55eff4644a3e40dbe24cdef4 *data/doges.rda | ||
77e2a2bc9b38abac7cf1a887602c5fd7 *R/marriage.graph.R | ||
c6823e379f6432d8f780a12900289f37 *R/marriage.graph.slice.R | ||
a80a70a5c9afe7eda37a9854b2ca7222 *README.md | ||
7e18666c56215cafc2c394f982144f6b *build/partial.rdb | ||
9452068e2fbfee1956973fd32e7d87e6 *build/vignette.rds | ||
660f8bab876041f72ee00ff1f51d3159 *data/doge.families.rda | ||
9ccc2d940145adf28aedcc878acea3fd *data/doges.marriages.rda | ||
e9f50d517a7eb633aee5d65836485067 *data/doges.rda | ||
3b76e2fd1fd95bf79e2a4ae96a7e6fc0 *data/doges.years.rda | ||
6c21d60801f2ba759fc31d6489113df3 *data/families.rda | ||
10aa16960c1b73d31f5227da9730ba02 *inst/REFERENCES.bib | ||
6a25bdc08e78429c8909e1de9cad3026 *inst/doc/counting-doge-families.R | ||
5a2585a9407c1f9fad2a9a5f146d1dd5 *inst/doc/counting-doge-families.Rmd | ||
36d13ff711cec3c5f417aa7453eb1660 *inst/doc/counting-doge-families.html | ||
380169b4531a27cb1691536102f1a631 *inst/doc/counting-doge-families.html | ||
350f5d9a9e0a5eb5a30348ae7696ae27 *inst/doc/doges-family-types.R | ||
9f3f78c5216d6c37e9a2857b4ce799c1 *inst/doc/doges-family-types.Rmd | ||
77fb6d71781b0e1428c78d77aa1e76c5 *inst/doc/doges-family-types.html | ||
dba77f048d676f4adf5da41b38e6eca1 *inst/doc/doges-family-types.html | ||
00e7cf8fdf6c27b11130a10fd93706be *inst/doc/doges-social-network.R | ||
10fc93d4697d24d9673bdf82069d7b4f *inst/doc/doges-social-network.Rmd | ||
4380da2f12bc7732609c4d9074db07b5 *inst/doc/doges-social-network.html | ||
61862bef8c7d863295e3e6c0624aacd5 *inst/doc/doges-terms.R | ||
9e70d0db982fe1ed4ee311fd75e0ea0e *inst/doc/doges-terms.Rmd | ||
fbc534a28aac08b7b19fb24dc2818211 *inst/doc/doges-terms.html | ||
b0ff3a52065853aedb34851db83622cb *inst/doc/doges-social-network.Rmd | ||
ccd9bd7e514c167276a316dbf6f0b8ef *inst/doc/doges-social-network.html | ||
a74e2f92fefe60d7bb6eefa64d82db0e *inst/doc/doges-split-social-network.R | ||
7d5799a8b1231861a880721436629e06 *inst/doc/doges-split-social-network.Rmd | ||
005af736e24061a814ea88c900c25315 *inst/doc/doges-split-social-network.html | ||
161bdc49e7dbc2e07d4d16a9f850ee69 *inst/doc/doges-terms.R | ||
701c7cd2c68b8ffba018aab49160d854 *inst/doc/doges-terms.Rmd | ||
94e7665670680af84a9f91c2bccb15da *inst/doc/doges-terms.html | ||
3c1b99fa60e54953f433b178b7d87f91 *inst/doges.bib | ||
67c172b488abd266e3c350306e43fd46 *man/doge.families.Rd | ||
0e184505f55c8dc69ddc12ca4f08c665 *man/doges.Rd | ||
5041838acbb727af7fc3591935f9e297 *man/doges.marriages.Rd | ||
eb1370e88a84f107ae159e449e235c6b *man/doges.years.Rd | ||
d57174905c8ee8aef9c35372d811ea10 *man/doges.years.Rd | ||
f214f1277343c214e61f1b117a39115e *man/families.Rd | ||
cc0c8409c340c8b5efce90c8bad3d62b *man/marriage.graph.Rd | ||
f2187d2d510a86dcb52a4db674aa8c1e *man/marriage.graph.slice.Rd | ||
1d971f3ebe61e9a030d862e2a0eb2c63 *tests/testthat.R | ||
9649b861ab1a5f3b92b303511e558ddf *tests/testthat/test-dogesdata.R | ||
1c7c606abf4483566e42485c77687f41 *tests/testthat/test-dogesyearsdata.R | ||
a858fa0b763bc9da841c99e54aba72b2 *tests/testthat/test-marriagegraph.R | ||
67e4c0cb56799101d4a6638e7f433e3d *tests/testthat/test-dogesdata.R | ||
d1e14f44066332f94e32fb06e4cbdcf0 *tests/testthat/test-dogesyearsdata.R | ||
ba438b58fc6557e9584c71c25ba3ff19 *tests/testthat/test-marriagegraph-slice.R | ||
d1d368569da96d95b9220b861996b2d5 *tests/testthat/test-marriagegraph.R | ||
5a2585a9407c1f9fad2a9a5f146d1dd5 *vignettes/counting-doge-families.Rmd | ||
9f3f78c5216d6c37e9a2857b4ce799c1 *vignettes/doges-family-types.Rmd | ||
10fc93d4697d24d9673bdf82069d7b4f *vignettes/doges-social-network.Rmd | ||
9e70d0db982fe1ed4ee311fd75e0ea0e *vignettes/doges-terms.Rmd | ||
b0ff3a52065853aedb34851db83622cb *vignettes/doges-social-network.Rmd | ||
7d5799a8b1231861a880721436629e06 *vignettes/doges-split-social-network.Rmd | ||
701c7cd2c68b8ffba018aab49160d854 *vignettes/doges-terms.Rmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
globalVariables(c("doges.marriages.sn")) | ||
library(igraph) | ||
|
||
globalVariables(c("doges.marriages.sn","family.types")) | ||
|
||
#' Convert doges data into a social graph | ||
#' | ||
#' @return An graph with noble families as nodes, edges representing marriages of doges or parents | ||
#' @importFrom igraph V V<- | ||
#' | ||
#' @return A graph with noble families as nodes, edges representing marriages of doges or parents; the type of family is the attribute family.type | ||
#' @export | ||
#' | ||
# | ||
|
||
marriage.graph <- function() { | ||
V(doges.marriages.sn)$family.type <- sapply( V(doges.marriages.sn)$name, function(x) family.types[x] ) | ||
return(doges.marriages.sn) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
library(igraph) | ||
|
||
globalVariables(c("data.doges")) | ||
|
||
#' Convert doges data into a social graph | ||
#' @param from Exact name of the doge, Orso (first doge) by default | ||
#' @param to Exact name of the last doge, Ludovico Manin (last one) by default | ||
#' @return A graph with noble families as nodes, edges representing marriages of doges or parents; the type of family is the attribute family.type | ||
#' @export | ||
#' | ||
# | ||
|
||
marriage.graph.slice <- function(..., from="Orso",to="Ludovico Manin") { | ||
from.index <- which(data.doges$Doge == from )[1] | ||
to.values <- which(data.doges$Doge == to ) | ||
to.index <- to.values[length(to.values)] | ||
sliced <- data.doges[from.index:to.index,] | ||
doges.marriages.df <- data.frame(sliced$Family.doge,sliced$Family.dogaressa) | ||
doges.marriages.df <- doges.marriages.df[ (doges.marriages.df$sliced.Family.doge != '' ) & (doges.marriages.df$sliced.Family.dogaressa != ''),] | ||
doges.mothers.df <- data.frame(sliced$Family.doge,sliced$Family.mother) | ||
doges.mothers.df <- doges.mothers.df[ (doges.mothers.df$sliced.Family.doge != '' ) & (doges.mothers.df$sliced.Family.mother != ''),] | ||
all.links <- data.frame(doge.or.father = c(doges.marriages.df$sliced.Family.doge,doges.mothers.df$sliced.Family.doge), | ||
dogaressa.or.mother = c(doges.marriages.df$sliced.Family.dogaressa,doges.mothers.df$sliced.Family.mother)) | ||
return(graph.data.frame(all.links,directed=F)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## ----setup, include = FALSE--------------------------------------------------- | ||
knitr::opts_chunk$set( | ||
collapse = TRUE, | ||
comment = "#>" | ||
) | ||
|
||
## ----load, warning=FALSE,message=FALSE---------------------------------------- | ||
library(dogesr) | ||
library(igraph) | ||
|
||
pre.serrata <- marriage.graph.slice(to="Pietro Gradenigo") | ||
post.serrata <- marriage.graph.slice(from="Marino Zorzi") | ||
|
||
## ----simplify----------------------------------------------------------------- | ||
weightify <- function( a.graph ) { | ||
other.graph <- a.graph | ||
E(other.graph)$weight <- 1 | ||
other.graph <- simplify(other.graph, edge.attr.comb=list(weight="sum")) | ||
return(other.graph) | ||
} | ||
pre.serrata <- weightify(pre.serrata) | ||
post.serrata <- weightify(post.serrata) | ||
|
||
V(pre.serrata)$EV <- unname(unlist(eigen_centrality(pre.serrata)$vector)) | ||
V(post.serrata)$EV <- unname(unlist(eigen_centrality(post.serrata)$vector)) | ||
plot(pre.serrata,vertex.size=V(pre.serrata)$EV, layout=layout_nicely, vertex.label.cex=0.7) | ||
plot(post.serrata,vertex.size=V(post.serrata)$EV, layout=layout_nicely, vertex.label.cex=0.7) | ||
|
Oops, something went wrong.