ancestry: Get a set number of ancestors based on name and Math Gen ID

View source: R/ancestors.R

ancestryR Documentation

Get a set number of ancestors based on name and Math Gen ID

Description

Starting from the given node, doctoral advisors are followed recursively for the specified number of steps. In case no advisor is known, the algorithm stops even if the number of steps is not yet reached. Loops in the academic tree (thicket??) are problematic - e.g. if a person was advised by two advisors, and one of them was an advisor to the other (advised by both academic brother and father). This results in duplicate entries. Each call to ancestry results in multiple requests to the Mathematics Genealogy Project, so use responsibly.

Usage

ancestry(id, steps, verbose = FALSE, includeself = TRUE)

Arguments

id

identifier given to a mathematician in the Mathematics Genealogy Project.

steps

integer number of number of steps to follow from the root

verbose

Boolean - should results be reported during the scraping? defaults to FALSE.

includeself

include information on the starting id into the output? defaults to TRUE

Value

data frame with the following variables

  • Name name of the mathematician

  • mgID Math Gen ID

  • School university granting the degree

  • Thesistitle

  • Degree

  • Year

  • advisorName

  • advisorMGID Math Gen ID of the advisor(s)

Examples

## Not run: 
hw <- ancestry(id = 145799, steps = 4) # Hadley Wickham
ancestry(id = 145799,  steps = 2, siblings = TRUE) # Hadley Wickham
dh <- ancestry(id=7298,  steps = 5) # David Hilbert

library(ggplot2)
library(geomnet)
hw <- plyr::rbind.fill(data.frame(advisorMGID=145799, advisorName="Hadley Alexander Wickham"), hw)
ggplot() +
  geom_net(aes(from_id=factor(advisorMGID), to_id=factor(mgID),
               label=advisorName), directed=TRUE, data=hw) +
  theme_net() + xlim(c(-0.1, 1.1))
qplot(y = rep(1:10, length=nrow(dh)), x=as.numeric(as.character(Year)), label = Name,
      data=dh, geom="label", alpha = I(0.5))

## End(Not run)

heike/mathGen documentation built on Sept. 18, 2022, 11:56 a.m.