1 Proof of concept

Since I want to test the effect of departmental prestige in relation to individual prestige within the collaboration network of Dutch sociologists, I first had to get data on departments and on individual sociologists. I found out that the staff webpages differ quite a lot in their code structure, and I found it out the hard way. I chose the sociology department at the Vrije Universiteit for this trial run.

I scraped the webpage and removed the rows that did not contain relevant data. Then I created a table, the original odd rows becoming names of sociologists and the original even rows representing the sociologists’ functions.

For a measure of individual prestige, I went for the amount of works and the amount of citations per sociologist. As I want departmental prestige to be the sum of citation scores of all members of the department, I did not test departmental prestige yet. This is because I first want to make sure my measure for individual prestige is operational. If this is the case, I can sum members to form a department.

Operationalising departmental prestige as such will also include faculty size, which has been used as a measure for the same variable in literature (e.g. Burris, 2004).


# install.packages('data.table')
library(data.table) 
library(tidyverse)  
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.2
## ✔ ggplot2   4.0.0     ✔ tibble    3.3.0
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.1.0     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::between()     masks data.table::between()
## ✖ dplyr::filter()      masks stats::filter()
## ✖ dplyr::first()       masks data.table::first()
## ✖ lubridate::hour()    masks data.table::hour()
## ✖ lubridate::isoweek() masks data.table::isoweek()
## ✖ dplyr::lag()         masks stats::lag()
## ✖ dplyr::last()        masks data.table::last()
## ✖ lubridate::mday()    masks data.table::mday()
## ✖ lubridate::minute()  masks data.table::minute()
## ✖ lubridate::month()   masks data.table::month()
## ✖ lubridate::quarter() masks data.table::quarter()
## ✖ lubridate::second()  masks data.table::second()
## ✖ purrr::transpose()   masks data.table::transpose()
## ✖ lubridate::wday()    masks data.table::wday()
## ✖ lubridate::week()    masks data.table::week()
## ✖ lubridate::yday()    masks data.table::yday()
## ✖ lubridate::year()    masks data.table::year()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
# install.packages('httr') # we don't need this for now require(httr)

require(xml2)
## Loading required package: xml2
require(rvest)
## Loading required package: rvest
## 
## Attaching package: 'rvest'
## 
## The following object is masked from 'package:readr':
## 
##     guess_encoding
require(devtools)
## Loading required package: devtools
## Loading required package: usethis
# Note we're doing something different here. We're installing a *latest* version directly from
# GitHub This is because the released version of this packages contains some errors!
devtools::install_github("jkeirstead/scholar")
## Using GitHub PAT from the git credential store.
## Skipping install of 'scholar' from a github remote, the SHA1 (2e0a4ca0) has not changed since last install.
##   Use `force = TRUE` to force installation
require(scholar)
## Loading required package: scholar
library(knitr)

# define workdirectory, note the double *backslashes* if you're on windows setwd('/yourpathhere)'

setwd('/Users/ghislaine/Downloads/Github/Social Networks/Webscraping for lab 4')
# Let's first get the staff page read_html is a function that simply extracts html webpages and
# puts them in xml format

Rvu_staff <- read_html("https://vu.nl/en/about-vu/faculties/school-of-social-sciences/teams/staff-sociology")

#> Error in open.connection(x, "rb"): HTTP error 404.

# so we need to find WHERE the table is located in the html 'inspect element' in mozilla firefox or
# 'view page source' and you see that everything AFTER /td in the 'body' of the page seems to be
# the table we do need

vu_staff <- Rvu_staff %>%
    rvest::html_nodes("body") %>%
    xml2::xml_find_all("//p") %>%
    rvest::html_text2()

vu_staff
##   [1] "Click on \"read more\" to go to the corresponding research profile."                                                                                                                                                                                                                                                                                            
##   [2] "dr. Jens Abbing"                                                                                                                                                                                                                                                                                                                                                
##   [3] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
##   [4] "Nazar Abdulazeez"                                                                                                                                                                                                                                                                                                                                               
##   [5] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##   [6] "Petra van Aken"                                                                                                                                                                                                                                                                                                                                                 
##   [7] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##   [8] "Carlijn van Alphen"                                                                                                                                                                                                                                                                                                                                             
##   [9] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [10] "Carla Bakboord"                                                                                                                                                                                                                                                                                                                                                 
##  [11] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [12] "prof. dr. René Bekkers"                                                                                                                                                                                                                                                                                                                                         
##  [13] "Professor"                                                                                                                                                                                                                                                                                                                                                      
##  [14] "prof. dr. ir. Alice de Boer"                                                                                                                                                                                                                                                                                                                                    
##  [15] "Endowed chair"                                                                                                                                                                                                                                                                                                                                                  
##  [16] "Henriëtte Boersma-de Vries"                                                                                                                                                                                                                                                                                                                                     
##  [17] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [18] "dr. Stef Bouwhuis"                                                                                                                                                                                                                                                                                                                                              
##  [19] "Assistant Professor"                                                                                                                                                                                                                                                                                                                                            
##  [20] "prof. dr. Marjolein Broese Van Groenou"                                                                                                                                                                                                                                                                                                                         
##  [21] "Professor"                                                                                                                                                                                                                                                                                                                                                      
##  [22] "Anika Chowdhury"                                                                                                                                                                                                                                                                                                                                                
##  [23] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [24] "prof. dr. Maurice Crul"                                                                                                                                                                                                                                                                                                                                         
##  [25] "Professor"                                                                                                                                                                                                                                                                                                                                                      
##  [26] "prof. dr. Kathy Davis"                                                                                                                                                                                                                                                                                                                                          
##  [27] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
##  [28] "Gözde Duran"                                                                                                                                                                                                                                                                                                                                                    
##  [29] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [30] "Laura Eberlein"                                                                                                                                                                                                                                                                                                                                                 
##  [31] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [32] "Eddy Elmer"                                                                                                                                                                                                                                                                                                                                                     
##  [33] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [34] "Muhammad Farooq"                                                                                                                                                                                                                                                                                                                                                
##  [35] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [36] "prof. dr. Harry Ganzeboom"                                                                                                                                                                                                                                                                                                                                      
##  [37] "Emiritus professor"                                                                                                                                                                                                                                                                                                                                             
##  [38] "dr. Mauricio Garnier Villarreal"                                                                                                                                                                                                                                                                                                                                
##  [39] "Assistant Professor"                                                                                                                                                                                                                                                                                                                                            
##  [40] "prof. dr. Halleh Ghorashi"                                                                                                                                                                                                                                                                                                                                      
##  [41] "Professor"                                                                                                                                                                                                                                                                                                                                                      
##  [42] "Santiago Gómez-Echeverry"                                                                                                                                                                                                                                                                                                                                       
##  [43] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [44] "Boudewijn Goos"                                                                                                                                                                                                                                                                                                                                                 
##  [45] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [46] "Alexandra Greene"                                                                                                                                                                                                                                                                                                                                               
##  [47] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [48] "Saba Hamzah"                                                                                                                                                                                                                                                                                                                                                    
##  [49] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
##  [50] "Fabian Holle"                                                                                                                                                                                                                                                                                                                                                   
##  [51] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [52] "Barry Hoolwerf"                                                                                                                                                                                                                                                                                                                                                 
##  [53] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
##  [54] "Olena van Horick"                                                                                                                                                                                                                                                                                                                                               
##  [55] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [56] "dr. Mariska van der Horst"                                                                                                                                                                                                                                                                                                                                      
##  [57] "Assistant professor"                                                                                                                                                                                                                                                                                                                                            
##  [58] "prof. dr. Martijn Huisman"                                                                                                                                                                                                                                                                                                                                      
##  [59] "Professor"                                                                                                                                                                                                                                                                                                                                                      
##  [60] "dr. Erik van Ingen"                                                                                                                                                                                                                                                                                                                                             
##  [61] "Associate professor"                                                                                                                                                                                                                                                                                                                                            
##  [62] "dr. Laura Keesman"                                                                                                                                                                                                                                                                                                                                              
##  [63] "Assistant professor"                                                                                                                                                                                                                                                                                                                                            
##  [64] "dr. Elif Keskiner"                                                                                                                                                                                                                                                                                                                                              
##  [65] "Associate professor"                                                                                                                                                                                                                                                                                                                                            
##  [66] "prof. dr. Saskia Keuzenkamp"                                                                                                                                                                                                                                                                                                                                    
##  [67] "Endowed chair"                                                                                                                                                                                                                                                                                                                                                  
##  [68] "Saba Aslam Khan"                                                                                                                                                                                                                                                                                                                                                
##  [69] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [70] "dr. Silvia Klokgieters"                                                                                                                                                                                                                                                                                                                                         
##  [71] "Assistant Professor"                                                                                                                                                                                                                                                                                                                                            
##  [72] "dr. Almar Kok"                                                                                                                                                                                                                                                                                                                                                  
##  [73] "Associate professor"                                                                                                                                                                                                                                                                                                                                            
##  [74] "dr. Stephanie Koolen-Maas"                                                                                                                                                                                                                                                                                                                                      
##  [75] "Project manager"                                                                                                                                                                                                                                                                                                                                                
##  [76] "Marga Korporaal"                                                                                                                                                                                                                                                                                                                                                
##  [77] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [78] "Timo Korstenbroek"                                                                                                                                                                                                                                                                                                                                              
##  [79] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [80] "Zsuzsa Kovács"                                                                                                                                                                                                                                                                                                                                                  
##  [81] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [82] "Nebil Kusmallah"                                                                                                                                                                                                                                                                                                                                                
##  [83] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
##  [84] "Frans Lelie"                                                                                                                                                                                                                                                                                                                                                    
##  [85] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
##  [86] "prof. dr. Aat Liefbroer"                                                                                                                                                                                                                                                                                                                                        
##  [87] "Endowed chair"                                                                                                                                                                                                                                                                                                                                                  
##  [88] "dr. Marie Lindegaard"                                                                                                                                                                                                                                                                                                                                           
##  [89] "Professor"                                                                                                                                                                                                                                                                                                                                                      
##  [90] "Max Littel"                                                                                                                                                                                                                                                                                                                                                     
##  [91] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
##  [92] "Laura Vargas Llona"                                                                                                                                                                                                                                                                                                                                             
##  [93] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
##  [94] "Helenard Louw"                                                                                                                                                                                                                                                                                                                                                  
##  [95] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
##  [96] "prof. Ineke Maas"                                                                                                                                                                                                                                                                                                                                               
##  [97] "Endowed chair"                                                                                                                                                                                                                                                                                                                                                  
##  [98] "Elly Mariani"                                                                                                                                                                                                                                                                                                                                                   
##  [99] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
## [100] "Salma Mataich"                                                                                                                                                                                                                                                                                                                                                  
## [101] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
## [102] "Phoebe Mbasalaki"                                                                                                                                                                                                                                                                                                                                               
## [103] "Research assistant"                                                                                                                                                                                                                                                                                                                                             
## [104] "prof. dr. Eva-Maria Merz"                                                                                                                                                                                                                                                                                                                                       
## [105] "Professor"                                                                                                                                                                                                                                                                                                                                                      
## [106] "Stefan Metaal"                                                                                                                                                                                                                                                                                                                                                  
## [107] "Lecturer"                                                                                                                                                                                                                                                                                                                                                       
## [108] "dr. Nasser Mohamedhoesein"                                                                                                                                                                                                                                                                                                                                      
## [109] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
## [110] "dr. Andrea Mudd"                                                                                                                                                                                                                                                                                                                                                
## [111] "Assistant Professor"                                                                                                                                                                                                                                                                                                                                            
## [112] "dr. Jasper Muis"                                                                                                                                                                                                                                                                                                                                                
## [113] "Assistant professor"                                                                                                                                                                                                                                                                                                                                            
## [114] "dr. Ineke Nagel"                                                                                                                                                                                                                                                                                                                                                
## [115] "Assistant professor"                                                                                                                                                                                                                                                                                                                                            
## [116] "dr. Nadira Ismail Omarjee"                                                                                                                                                                                                                                                                                                                                      
## [117] "Lecturer"                                                                                                                                                                                                                                                                                                                                                       
## [118] "Maartje Orsel"                                                                                                                                                                                                                                                                                                                                                  
## [119] "Research associate"                                                                                                                                                                                                                                                                                                                                             
## [120] "Joram Pach"                                                                                                                                                                                                                                                                                                                                                     
## [121] "Lecturer, PhD candidate"                                                                                                                                                                                                                                                                                                                                        
## [122] "dr. Dimitris Pavlopoulos"                                                                                                                                                                                                                                                                                                                                       
## [123] "Associate professor"                                                                                                                                                                                                                                                                                                                                            
## [124] "dr. Elena Ponzoni"                                                                                                                                                                                                                                                                                                                                              
## [125] "Assistant professor"                                                                                                                                                                                                                                                                                                                                            
## [126] "Marlou Ramaekers"                                                                                                                                                                                                                                                                                                                                               
## [127] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
## [128] "Anja Robertus"                                                                                                                                                                                                                                                                                                                                                  
## [129] "Communication and office manager"                                                                                                                                                                                                                                                                                                                               
## [130] "Shashi Roopram"                                                                                                                                                                                                                                                                                                                                                 
## [131] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
## [132] "Sajad Salmanpour"                                                                                                                                                                                                                                                                                                                                               
## [133] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
## [134] "Josje Schut"                                                                                                                                                                                                                                                                                                                                                    
## [135] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
## [136] "prof. dr. Theo Schuyt"                                                                                                                                                                                                                                                                                                                                          
## [137] "Emeritus professor"                                                                                                                                                                                                                                                                                                                                             
## [138] "Sajad Sepehri"                                                                                                                                                                                                                                                                                                                                                  
## [139] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
## [140] "Ying Shen"                                                                                                                                                                                                                                                                                                                                                      
## [141] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
## [142] "dr. Mansoureh Shojaee"                                                                                                                                                                                                                                                                                                                                          
## [143] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
## [144] "Tamira Sno"                                                                                                                                                                                                                                                                                                                                                     
## [145] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
## [146] "Melisa Soto Lafontaine"                                                                                                                                                                                                                                                                                                                                         
## [147] "Lecturer"                                                                                                                                                                                                                                                                                                                                                       
## [148] "Sarah Sramota"                                                                                                                                                                                                                                                                                                                                                  
## [149] "Lecturer"                                                                                                                                                                                                                                                                                                                                                       
## [150] "Koen Steenks"                                                                                                                                                                                                                                                                                                                                                   
## [151] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
## [152] "Josine Steenvoorde"                                                                                                                                                                                                                                                                                                                                             
## [153] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
## [154] "prof. dr. Jacquelien van Stekelenburg"                                                                                                                                                                                                                                                                                                                          
## [155] "Professor, ReSCU Lab"                                                                                                                                                                                                                                                                                                                                           
## [156] "dr. Joukje Swinkels"                                                                                                                                                                                                                                                                                                                                            
## [157] "Assistant Professor"                                                                                                                                                                                                                                                                                                                                            
## [158] "dr. Saartje Tack"                                                                                                                                                                                                                                                                                                                                               
## [159] "Assistant Professor"                                                                                                                                                                                                                                                                                                                                            
## [160] "Tara Tankink"                                                                                                                                                                                                                                                                                                                                                   
## [161] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
## [162] "Els Tettelaar"                                                                                                                                                                                                                                                                                                                                                  
## [163] "Office manager"                                                                                                                                                                                                                                                                                                                                                 
## [164] "prof. dr. Anne-Mei The"                                                                                                                                                                                                                                                                                                                                         
## [165] "Endowed chair"                                                                                                                                                                                                                                                                                                                                                  
## [166] "dr. Lex Thijssen"                                                                                                                                                                                                                                                                                                                                               
## [167] "Assistant professor"                                                                                                                                                                                                                                                                                                                                            
## [168] "prof. dr. Theo van Tilburg"                                                                                                                                                                                                                                                                                                                                     
## [169] "Emeritus professor"                                                                                                                                                                                                                                                                                                                                             
## [170] "Nina Vergeldt"                                                                                                                                                                                                                                                                                                                                                  
## [171] "Lecturer"                                                                                                                                                                                                                                                                                                                                                       
## [172] "dr. Ismintha Waldring"                                                                                                                                                                                                                                                                                                                                          
## [173] "Assistant professor"                                                                                                                                                                                                                                                                                                                                            
## [174] "prof. dr. Pamala Wiepking"                                                                                                                                                                                                                                                                                                                                      
## [175] "Professor"                                                                                                                                                                                                                                                                                                                                                      
## [176] "dr. Arjen de Wit"                                                                                                                                                                                                                                                                                                                                               
## [177] "Assistant professor"                                                                                                                                                                                                                                                                                                                                            
## [178] "Lisa Woensdregt"                                                                                                                                                                                                                                                                                                                                                
## [179] "Assistant Professor"                                                                                                                                                                                                                                                                                                                                            
## [180] "Louise Wolff"                                                                                                                                                                                                                                                                                                                                                   
## [181] "Lecturer"                                                                                                                                                                                                                                                                                                                                                       
## [182] "Younes Younes"                                                                                                                                                                                                                                                                                                                                                  
## [183] "PhD candidate"                                                                                                                                                                                                                                                                                                                                                  
## [184] "Amber Zegers"                                                                                                                                                                                                                                                                                                                                                   
## [185] "Researcher"                                                                                                                                                                                                                                                                                                                                                     
## [186] "This website uses cookies"                                                                                                                                                                                                                                                                                                                                      
## [187] "You can accept all cookies or set your preferences per cookie category. You can always alter your choice by removing the cookies from your browser. VU Amsterdam and others use cookies to: 1) analyse website use; 2) personalise the website; 3) connect to social media networks; 4) show relevant advertisements. More information about the cookies we use"
## [188] "This website uses cookies"                                                                                                                                                                                                                                                                                                                                      
## [189] "You can accept all cookies or set your preferences per cookie category. You can always alter your choice by removing the cookies from your browser. VU Amsterdam and others use cookies to: 1) analyse website use; 2) personalise the website; 3) connect to social media networks; 4) show relevant advertisements. More information about the cookies we use"
## [190] "Cookie preferences"                                                                                                                                                                                                                                                                                                                                             
## [191] "You can accept all cookies or you can set your preferences per cookie category. You can always alter your choice by removing the cookies from your browser. See more information in the cookie statement."                                                                                                                                                      
## [192] "Personal settings:"                                                                                                                                                                                                                                                                                                                                             
## [193] "Functional"                                                                                                                                                                                                                                                                                                                                                     
## [194] "These cookies are used to ensure that our website operates properly."                                                                                                                                                                                                                                                                                           
## [195] "Analytics"                                                                                                                                                                                                                                                                                                                                                      
## [196] "These cookies help to analyse the use of the website. These measurement data are subsequently used to improve the website."                                                                                                                                                                                                                                     
## [197] "Personalisation"                                                                                                                                                                                                                                                                                                                                                
## [198] "These cookies are used to analyse how you use our website. This enables us to adapt our website content with information that suits your interests."                                                                                                                                                                                                            
## [199] "Social media"                                                                                                                                                                                                                                                                                                                                                   
## [200] "These cookies are placed by social media networks. For example, if you watch a YouTube video embedded in the website, or use the social media buttons on our website to share or like a post. This allows social media networks to track your internet behaviour and use that for their own purposes."                                                          
## [201] "Advertising"                                                                                                                                                                                                                                                                                                                                                    
## [202] "These cookies are placed by advertising partners. They are used to show you relevant advertisements for Vrije Universiteit Amsterdam on other websites that you visit. They enable advertising networks to track your internet behaviour."                                                                                                                      
## [203] "Copyright © 2025 - Vrije Universiteit Amsterdam"
library(dplyr)

vu_staff <- as.list(vu_staff)

vu_staff2 <- as.data.frame(vu_staff)

vu_staff3 <- vu_staff2[-c(1, 186:203), ]

vu_staff4 <- as.list(vu_staff3) 

print(vu_staff4)
## $X.Click.on...read.more...to.go.to.the.corresponding.research.profile..
## character(0)
## 
## $X.dr..Jens.Abbing.
## character(0)
## 
## $X.Researcher.
## character(0)
## 
## $X.Nazar.Abdulazeez.
## character(0)
## 
## $X.PhD.candidate.
## character(0)
## 
## $X.Petra.van.Aken.
## character(0)
## 
## $X.PhD.candidate..1
## character(0)
## 
## $X.Carlijn.van.Alphen.
## character(0)
## 
## $X.PhD.candidate..2
## character(0)
## 
## $X.Carla.Bakboord.
## character(0)
## 
## $X.PhD.candidate..3
## character(0)
## 
## $X.prof..dr..René.Bekkers.
## character(0)
## 
## $X.Professor.
## character(0)
## 
## $X.prof..dr..ir..Alice.de.Boer.
## character(0)
## 
## $X.Endowed.chair.
## character(0)
## 
## $X.Henriëtte.Boersma.de.Vries.
## character(0)
## 
## $X.PhD.candidate..4
## character(0)
## 
## $X.dr..Stef.Bouwhuis.
## character(0)
## 
## $X.Assistant.Professor.
## character(0)
## 
## $X.prof..dr..Marjolein.Broese.Van.Groenou.
## character(0)
## 
## $X.Professor..1
## character(0)
## 
## $X.Anika.Chowdhury.
## character(0)
## 
## $X.PhD.candidate..5
## character(0)
## 
## $X.prof..dr..Maurice.Crul.
## character(0)
## 
## $X.Professor..2
## character(0)
## 
## $X.prof..dr..Kathy.Davis.
## character(0)
## 
## $X.Researcher..1
## character(0)
## 
## $X.Gözde.Duran.
## character(0)
## 
## $X.PhD.candidate..6
## character(0)
## 
## $X.Laura.Eberlein.
## character(0)
## 
## $X.PhD.candidate..7
## character(0)
## 
## $X.Eddy.Elmer.
## character(0)
## 
## $X.PhD.candidate..8
## character(0)
## 
## $X.Muhammad.Farooq.
## character(0)
## 
## $X.PhD.candidate..9
## character(0)
## 
## $X.prof..dr..Harry.Ganzeboom.
## character(0)
## 
## $X.Emiritus.professor.
## character(0)
## 
## $X.dr..Mauricio.Garnier.Villarreal.
## character(0)
## 
## $X.Assistant.Professor..1
## character(0)
## 
## $X.prof..dr..Halleh.Ghorashi.
## character(0)
## 
## $X.Professor..3
## character(0)
## 
## $X.Santiago.Gómez.Echeverry.
## character(0)
## 
## $X.PhD.candidate..10
## character(0)
## 
## $X.Boudewijn.Goos.
## character(0)
## 
## $X.PhD.candidate..11
## character(0)
## 
## $X.Alexandra.Greene.
## character(0)
## 
## $X.PhD.candidate..12
## character(0)
## 
## $X.Saba.Hamzah.
## character(0)
## 
## $X.Researcher..2
## character(0)
## 
## $X.Fabian.Holle.
## character(0)
## 
## $X.PhD.candidate..13
## character(0)
## 
## $X.Barry.Hoolwerf.
## character(0)
## 
## $X.Researcher..3
## character(0)
## 
## $X.Olena.van.Horick.
## character(0)
## 
## $X.PhD.candidate..14
## character(0)
## 
## $X.dr..Mariska.van.der.Horst.
## character(0)
## 
## $X.Assistant.professor.
## character(0)
## 
## $X.prof..dr..Martijn.Huisman.
## character(0)
## 
## $X.Professor..4
## character(0)
## 
## $X.dr..Erik.van.Ingen.
## character(0)
## 
## $X.Associate.professor.
## character(0)
## 
## $X.dr..Laura.Keesman.
## character(0)
## 
## $X.Assistant.professor..1
## character(0)
## 
## $X.dr..Elif.Keskiner.
## character(0)
## 
## $X.Associate.professor..1
## character(0)
## 
## $X.prof..dr..Saskia.Keuzenkamp.
## character(0)
## 
## $X.Endowed.chair..1
## character(0)
## 
## $X.Saba.Aslam.Khan.
## character(0)
## 
## $X.PhD.candidate..15
## character(0)
## 
## $X.dr..Silvia.Klokgieters.
## character(0)
## 
## $X.Assistant.Professor..2
## character(0)
## 
## $X.dr..Almar.Kok.
## character(0)
## 
## $X.Associate.professor..2
## character(0)
## 
## $X.dr..Stephanie.Koolen.Maas.
## character(0)
## 
## $X.Project.manager.
## character(0)
## 
## $X.Marga.Korporaal.
## character(0)
## 
## $X.PhD.candidate..16
## character(0)
## 
## $X.Timo.Korstenbroek.
## character(0)
## 
## $X.PhD.candidate..17
## character(0)
## 
## $X.Zsuzsa.Kovács.
## character(0)
## 
## $X.PhD.candidate..18
## character(0)
## 
## $X.Nebil.Kusmallah.
## character(0)
## 
## $X.Researcher..4
## character(0)
## 
## $X.Frans.Lelie.
## character(0)
## 
## $X.Researcher..5
## character(0)
## 
## $X.prof..dr..Aat.Liefbroer.
## character(0)
## 
## $X.Endowed.chair..2
## character(0)
## 
## $X.dr..Marie.Lindegaard.
## character(0)
## 
## $X.Professor..5
## character(0)
## 
## $X.Max.Littel.
## character(0)
## 
## $X.Researcher..6
## character(0)
## 
## $X.Laura.Vargas.Llona.
## character(0)
## 
## $X.Researcher..7
## character(0)
## 
## $X.Helenard.Louw.
## character(0)
## 
## $X.PhD.candidate..19
## character(0)
## 
## $X.prof..Ineke.Maas.
## character(0)
## 
## $X.Endowed.chair..3
## character(0)
## 
## $X.Elly.Mariani.
## character(0)
## 
## $X.PhD.candidate..20
## character(0)
## 
## $X.Salma.Mataich.
## character(0)
## 
## $X.Researcher..8
## character(0)
## 
## $X.Phoebe.Mbasalaki.
## character(0)
## 
## $X.Research.assistant.
## character(0)
## 
## $X.prof..dr..Eva.Maria.Merz.
## character(0)
## 
## $X.Professor..6
## character(0)
## 
## $X.Stefan.Metaal.
## character(0)
## 
## $X.Lecturer.
## character(0)
## 
## $X.dr..Nasser.Mohamedhoesein.
## character(0)
## 
## $X.Researcher..9
## character(0)
## 
## $X.dr..Andrea.Mudd.
## character(0)
## 
## $X.Assistant.Professor..3
## character(0)
## 
## $X.dr..Jasper.Muis.
## character(0)
## 
## $X.Assistant.professor..2
## character(0)
## 
## $X.dr..Ineke.Nagel.
## character(0)
## 
## $X.Assistant.professor..3
## character(0)
## 
## $X.dr..Nadira.Ismail.Omarjee.
## character(0)
## 
## $X.Lecturer..1
## character(0)
## 
## $X.Maartje.Orsel.
## character(0)
## 
## $X.Research.associate.
## character(0)
## 
## $X.Joram.Pach.
## character(0)
## 
## $X.Lecturer..PhD.candidate.
## character(0)
## 
## $X.dr..Dimitris.Pavlopoulos.
## character(0)
## 
## $X.Associate.professor..3
## character(0)
## 
## $X.dr..Elena.Ponzoni.
## character(0)
## 
## $X.Assistant.professor..4
## character(0)
## 
## $X.Marlou.Ramaekers.
## character(0)
## 
## $X.Researcher..10
## character(0)
## 
## $X.Anja.Robertus.
## character(0)
## 
## $X.Communication.and.office.manager.
## character(0)
## 
## $X.Shashi.Roopram.
## character(0)
## 
## $X.PhD.candidate..21
## character(0)
## 
## $X.Sajad.Salmanpour.
## character(0)
## 
## $X.Researcher..11
## character(0)
## 
## $X.Josje.Schut.
## character(0)
## 
## $X.PhD.candidate..22
## character(0)
## 
## $X.prof..dr..Theo.Schuyt.
## character(0)
## 
## $X.Emeritus.professor.
## character(0)
## 
## $X.Sajad.Sepehri.
## character(0)
## 
## $X.Researcher..12
## character(0)
## 
## $X.Ying.Shen.
## character(0)
## 
## $X.PhD.candidate..23
## character(0)
## 
## $X.dr..Mansoureh.Shojaee.
## character(0)
## 
## $X.Researcher..13
## character(0)
## 
## $X.Tamira.Sno.
## character(0)
## 
## $X.PhD.candidate..24
## character(0)
## 
## $X.Melisa.Soto.Lafontaine.
## character(0)
## 
## $X.Lecturer..2
## character(0)
## 
## $X.Sarah.Sramota.
## character(0)
## 
## $X.Lecturer..3
## character(0)
## 
## $X.Koen.Steenks.
## character(0)
## 
## $X.PhD.candidate..25
## character(0)
## 
## $X.Josine.Steenvoorde.
## character(0)
## 
## $X.PhD.candidate..26
## character(0)
## 
## $X.prof..dr..Jacquelien.van.Stekelenburg.
## character(0)
## 
## $X.Professor..ReSCU.Lab.
## character(0)
## 
## $X.dr..Joukje.Swinkels.
## character(0)
## 
## $X.Assistant.Professor..4
## character(0)
## 
## $X.dr..Saartje.Tack.
## character(0)
## 
## $X.Assistant.Professor..5
## character(0)
## 
## $X.Tara.Tankink.
## character(0)
## 
## $X.PhD.candidate..27
## character(0)
## 
## $X.Els.Tettelaar.
## character(0)
## 
## $X.Office.manager.
## character(0)
## 
## $X.prof..dr..Anne.Mei.The.
## character(0)
## 
## $X.Endowed.chair..4
## character(0)
## 
## $X.dr..Lex.Thijssen.
## character(0)
## 
## $X.Assistant.professor..5
## character(0)
## 
## $X.prof..dr..Theo.van.Tilburg.
## character(0)
## 
## $X.Emeritus.professor..1
## character(0)
## 
## $X.Nina.Vergeldt.
## character(0)
## 
## $X.Lecturer..4
## character(0)
## 
## $X.dr..Ismintha.Waldring.
## character(0)
## 
## $X.Assistant.professor..6
## character(0)
## 
## $X.prof..dr..Pamala.Wiepking.
## character(0)
## 
## $X.Professor..7
## character(0)
## 
## $X.dr..Arjen.de.Wit.
## character(0)
## 
## $X.Assistant.professor..7
## character(0)
## 
## $X.Lisa.Woensdregt.
## character(0)
## 
## $X.Assistant.Professor..6
## character(0)
## 
## $X.Louise.Wolff.
## character(0)
## 
## $X.Lecturer..5
## character(0)
## 
## $X.Younes.Younes.
## character(0)
## 
## $X.PhD.candidate..28
## character(0)
## 
## $X.Amber.Zegers.
## character(0)
## 
## $X.Researcher..14
## character(0)
## 
## $X.This.website.uses.cookies.
## character(0)
## 
## $...
## character(0)
## 
## $X.This.website.uses.cookies..1
## character(0)
## 
## $...
## character(0)
## 
## $X.Cookie.preferences.
## character(0)
## 
## $X.You.can.accept.all.cookies.or.you.can.set.your.preferences.per.cookie.category..You.can.always.alter.your.choice.by.removing.the.cookies.from.your.browser..See.more.information.in.the.cookie.statement..
## character(0)
## 
## $X.Personal.settings..
## character(0)
## 
## $X.Functional.
## character(0)
## 
## $X.These.cookies.are.used.to.ensure.that.our.website.operates.properly..
## character(0)
## 
## $X.Analytics.
## character(0)
## 
## $X.These.cookies.help.to.analyse.the.use.of.the.website..These.measurement.data.are.subsequently.used.to.improve.the.website..
## character(0)
## 
## $X.Personalisation.
## character(0)
## 
## $X.These.cookies.are.used.to.analyse.how.you.use.our.website..This.enables.us.to.adapt.our.website.content.with.information.that.suits.your.interests..
## character(0)
## 
## $X.Social.media.
## character(0)
## 
## $...
## character(0)
## 
## $X.Advertising.
## character(0)
## 
## $X.These.cookies.are.placed.by.advertising.partners..They.are.used.to.show.you.relevant.advertisements.for.Vrije.Universiteit.Amsterdam.on.other.websites.that.you.visit..They.enable.advertising.networks.to.track.your.internet.behaviour..
## character(0)
## 
## $X.Copyright...2025...Vrije.Universiteit.Amsterdam.
## character(0)
fodd <- function(x) x%%2 != 0
feven <- function(x) x%%2 == 0

vu_names <- vu_staff4[fodd(1:184)]

vu_function <- vu_staff4[feven(1:184)]

vu_df <- data.frame(cbind(vu_names, vu_function))
## Warning in cbind(vu_names, vu_function): number of rows of result is not a
## multiple of vector length (arg 2)
packages <- c("tidyverse", "scholar", "openalexR", "rvest", "jsonlite")

fpackage.check <- function(packages) {
    lapply(packages, FUN = function(x) {
        if (!require(x, character.only = TRUE)) {
            install.packages(x, dependencies = TRUE)
            library(x, character.only = TRUE)
        }
    })
}

fsave <- function(x, file = NULL, location = "./data/processed/") {
    ifelse(!dir.exists("data"), dir.create("data"), FALSE)
    ifelse(!dir.exists("data/processed"), dir.create("data/processed"), FALSE)
    if (is.null(file))
        file = deparse(substitute(x))
    datename <- substr(gsub("[:-]", "", Sys.time()), 1, 8)
    totalname <- paste(location, file, "_", datename, ".rda", sep = "")
    save(x, file = totalname)  #need to fix if file is reloaded as input name, not as x. 
}

fload <- function(filename) {
    load(filename)
    get(ls()[ls() != "filename"])
}

fshowdf <- function(x, ...) {
    knitr::kable(x, digits = 2, "html", ...) %>%
        kableExtra::kable_styling(bootstrap_options = c("striped", "hover")) %>%
        kableExtra::scroll_box(width = "100%", height = "300px")
}


fpackage.check(packages)
## Loading required package: openalexR
## openalexR v2.0.0 introduces breaking changes.
## See NEWS.md for details.
## 
## To suppress this message, add `openalexR.message = suppressed` to your .Renviron file.
## Loading required package: jsonlite
## 
## Attaching package: 'jsonlite'
## The following object is masked from 'package:purrr':
## 
##     flatten
## [[1]]
## NULL
## 
## [[2]]
## NULL
## 
## [[3]]
## NULL
## 
## [[4]]
## NULL
## 
## [[5]]
## NULL
library(openalexR)
library(tidyverse)
library(scholar)
library(rvest)
library(jsonlite)
lw_json <- fromJSON("https://api.openalex.org/people/A5009389179", simplifyVector = FALSE)

glimpse(lw_json)
## List of 17
##  $ id                       : chr "https://openalex.org/A5009389179"
##  $ orcid                    : chr "https://orcid.org/0000-0001-9301-533X"
##  $ display_name             : chr "Lise Woensdregt"
##  $ display_name_alternatives:List of 1
##   ..$ : chr "Lise Woensdregt"
##  $ works_count              : int 19
##  $ cited_by_count           : int 114
##  $ summary_stats            :List of 3
##   ..$ 2yr_mean_citedness: num 0.667
##   ..$ h_index           : int 6
##   ..$ i10_index         : int 3
##  $ ids                      :List of 2
##   ..$ openalex: chr "https://openalex.org/A5009389179"
##   ..$ orcid   : chr "https://orcid.org/0000-0001-9301-533X"
##  $ affiliations             :List of 4
##   ..$ :List of 2
##   .. ..$ institution:List of 6
##   .. ..$ years      :List of 6
##   ..$ :List of 2
##   .. ..$ institution:List of 6
##   .. ..$ years      :List of 3
##   ..$ :List of 2
##   .. ..$ institution:List of 6
##   .. ..$ years      :List of 2
##   ..$ :List of 2
##   .. ..$ institution:List of 6
##   .. ..$ years      :List of 1
##  $ last_known_institutions  :List of 1
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/I865915315"
##   .. ..$ ror         : chr "https://ror.org/008xxew50"
##   .. ..$ display_name: chr "Vrije Universiteit Amsterdam"
##   .. ..$ country_code: chr "NL"
##   .. ..$ type        : chr "funder"
##   .. ..$ lineage     :List of 1
##  $ topics                   :List of 21
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11350"
##   .. ..$ display_name: chr "Sex work and related issues"
##   .. ..$ count       : int 11
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11168"
##   .. ..$ display_name: chr "International Development and Aid"
##   .. ..$ count       : int 4
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T13843"
##   .. ..$ display_name: chr "African Sexualities and LGBTQ+ Issues"
##   .. ..$ count       : int 3
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11860"
##   .. ..$ display_name: chr "HIV, Drug Use, Sexual Risk"
##   .. ..$ count       : int 3
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T14464"
##   .. ..$ display_name: chr "Community Development and Social Impact"
##   .. ..$ count       : int 2
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11430"
##   .. ..$ display_name: chr "Disaster Response and Management"
##   .. ..$ count       : int 2
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11556"
##   .. ..$ display_name: chr "Poverty, Education, and Child Welfare"
##   .. ..$ count       : int 2
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T13839"
##   .. ..$ display_name: chr "Tourism, Volunteerism, and Development"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11300"
##   .. ..$ display_name: chr "Global Educational Policies and Reforms"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T10762"
##   .. ..$ display_name: chr "Migration, Health and Trauma"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T13456"
##   .. ..$ display_name: chr "Religion, Society, and Development"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T10082"
##   .. ..$ display_name: chr "HIV/AIDS Research and Interventions"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11933"
##   .. ..$ display_name: chr "Mining and Resource Management"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T12775"
##   .. ..$ display_name: chr "Legal Issues in South Africa"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11581"
##   .. ..$ display_name: chr "Viral Infections and Outbreaks Research"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T10149"
##   .. ..$ display_name: chr "Anthropological Studies and Insights"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11761"
##   .. ..$ display_name: chr "Resilience and Mental Health"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T13035"
##   .. ..$ display_name: chr "Human Rights and Development"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11540"
##   .. ..$ display_name: chr "Gender, Feminism, and Media"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T10156"
##   .. ..$ display_name: chr "LGBTQ Health, Identity, and Policy"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11639"
##   .. ..$ display_name: chr "Mental Health and Patient Involvement"
##   .. ..$ count       : int 1
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##  $ topic_share              :List of 21
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11350"
##   .. ..$ display_name: chr "Sex work and related issues"
##   .. ..$ value       : num 7.04e-05
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T13843"
##   .. ..$ display_name: chr "African Sexualities and LGBTQ+ Issues"
##   .. ..$ value       : num 6.7e-05
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T14464"
##   .. ..$ display_name: chr "Community Development and Social Impact"
##   .. ..$ value       : num 2.53e-05
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11860"
##   .. ..$ display_name: chr "HIV, Drug Use, Sexual Risk"
##   .. ..$ value       : num 2.19e-05
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11933"
##   .. ..$ display_name: chr "Mining and Resource Management"
##   .. ..$ value       : num 1.7e-05
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11168"
##   .. ..$ display_name: chr "International Development and Aid"
##   .. ..$ value       : num 1.36e-05
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T13839"
##   .. ..$ display_name: chr "Tourism, Volunteerism, and Development"
##   .. ..$ value       : num 1.27e-05
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11300"
##   .. ..$ display_name: chr "Global Educational Policies and Reforms"
##   .. ..$ value       : num 1.08e-05
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T10149"
##   .. ..$ display_name: chr "Anthropological Studies and Insights"
##   .. ..$ value       : num 1.06e-05
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11639"
##   .. ..$ display_name: chr "Mental Health and Patient Involvement"
##   .. ..$ value       : num 1.05e-05
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11581"
##   .. ..$ display_name: chr "Viral Infections and Outbreaks Research"
##   .. ..$ value       : num 9.5e-06
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11430"
##   .. ..$ display_name: chr "Disaster Response and Management"
##   .. ..$ value       : num 9.3e-06
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11556"
##   .. ..$ display_name: chr "Poverty, Education, and Child Welfare"
##   .. ..$ value       : num 9e-06
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T10156"
##   .. ..$ display_name: chr "LGBTQ Health, Identity, and Policy"
##   .. ..$ value       : num 8.8e-06
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11540"
##   .. ..$ display_name: chr "Gender, Feminism, and Media"
##   .. ..$ value       : num 7.4e-06
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T13035"
##   .. ..$ display_name: chr "Human Rights and Development"
##   .. ..$ value       : num 7.2e-06
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T12775"
##   .. ..$ display_name: chr "Legal Issues in South Africa"
##   .. ..$ value       : num 6.6e-06
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T10762"
##   .. ..$ display_name: chr "Migration, Health and Trauma"
##   .. ..$ value       : num 4.8e-06
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T11761"
##   .. ..$ display_name: chr "Resilience and Mental Health"
##   .. ..$ value       : num 4.4e-06
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T10082"
##   .. ..$ display_name: chr "HIV/AIDS Research and Interventions"
##   .. ..$ value       : num 3.9e-06
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##   ..$ :List of 6
##   .. ..$ id          : chr "https://openalex.org/T13456"
##   .. ..$ display_name: chr "Religion, Society, and Development"
##   .. ..$ value       : num 2.9e-06
##   .. ..$ subfield    :List of 2
##   .. ..$ field       :List of 2
##   .. ..$ domain      :List of 2
##  $ x_concepts               :List of 25
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C17744445"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q36442"
##   .. ..$ display_name: chr "Political science"
##   .. ..$ level       : int 0
##   .. ..$ score       : num 89.5
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C199539241"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q7748"
##   .. ..$ display_name: chr "Law"
##   .. ..$ level       : int 1
##   .. ..$ score       : num 73.7
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C144024400"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q21201"
##   .. ..$ display_name: chr "Sociology"
##   .. ..$ level       : int 0
##   .. ..$ score       : num 68.4
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C86803240"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q420"
##   .. ..$ display_name: chr "Biology"
##   .. ..$ level       : int 0
##   .. ..$ score       : num 63.2
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C15744967"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q9418"
##   .. ..$ display_name: chr "Psychology"
##   .. ..$ level       : int 0
##   .. ..$ score       : num 57.9
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C71924100"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q11190"
##   .. ..$ display_name: chr "Medicine"
##   .. ..$ level       : int 0
##   .. ..$ score       : num 52.6
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C162324750"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q8134"
##   .. ..$ display_name: chr "Economics"
##   .. ..$ level       : int 0
##   .. ..$ score       : num 52.6
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C121332964"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q413"
##   .. ..$ display_name: chr "Physics"
##   .. ..$ level       : int 0
##   .. ..$ score       : num 47.4
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C62520636"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q944"
##   .. ..$ display_name: chr "Quantum mechanics"
##   .. ..$ level       : int 1
##   .. ..$ score       : num 42.1
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C94625758"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q7163"
##   .. ..$ display_name: chr "Politics"
##   .. ..$ level       : int 2
##   .. ..$ score       : num 42.1
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C205649164"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q1071"
##   .. ..$ display_name: chr "Geography"
##   .. ..$ level       : int 0
##   .. ..$ score       : num 42.1
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C107993555"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q1662673"
##   .. ..$ display_name: chr "Gender studies"
##   .. ..$ level       : int 1
##   .. ..$ score       : num 36.8
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C138885662"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q5891"
##   .. ..$ display_name: chr "Philosophy"
##   .. ..$ level       : int 0
##   .. ..$ score       : num 36.8
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C159047783"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q7215"
##   .. ..$ display_name: chr "Virology"
##   .. ..$ level       : int 1
##   .. ..$ score       : num 36.8
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C19165224"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q23404"
##   .. ..$ display_name: chr "Anthropology"
##   .. ..$ level       : int 1
##   .. ..$ score       : num 31.6
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C50522688"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q189833"
##   .. ..$ display_name: chr "Economic growth"
##   .. ..$ level       : int 1
##   .. ..$ score       : num 31.6
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C95457728"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q309"
##   .. ..$ display_name: chr "History"
##   .. ..$ level       : int 0
##   .. ..$ score       : num 31.6
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C203014093"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q101929"
##   .. ..$ display_name: chr "Immunology"
##   .. ..$ level       : int 1
##   .. ..$ score       : num 31.6
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C512399662"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q3505712"
##   .. ..$ display_name: chr "Family medicine"
##   .. ..$ level       : int 1
##   .. ..$ score       : num 31.6
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C2780100914"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q1297897"
##   .. ..$ display_name: chr "Sex work"
##   .. ..$ level       : int 3
##   .. ..$ score       : num 31.6
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C3013748606"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q15787"
##   .. ..$ display_name: chr "Human immunodeficiency virus (HIV)"
##   .. ..$ level       : int 2
##   .. ..$ score       : num 31.6
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C18903297"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q7150"
##   .. ..$ display_name: chr "Ecology"
##   .. ..$ level       : int 1
##   .. ..$ score       : num 26.3
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C41008148"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q21198"
##   .. ..$ display_name: chr "Computer science"
##   .. ..$ level       : int 0
##   .. ..$ score       : num 26.3
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C97355855"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q11473"
##   .. ..$ display_name: chr "Thermodynamics"
##   .. ..$ level       : int 1
##   .. ..$ score       : num 26.3
##   ..$ :List of 5
##   .. ..$ id          : chr "https://openalex.org/C111472728"
##   .. ..$ wikidata    : chr "https://www.wikidata.org/wiki/Q9471"
##   .. ..$ display_name: chr "Epistemology"
##   .. ..$ level       : int 1
##   .. ..$ score       : num 26.3
##  $ counts_by_year           :List of 9
##   ..$ :List of 4
##   .. ..$ year          : int 2025
##   .. ..$ works_count   : int 1
##   .. ..$ oa_works_count: int 0
##   .. ..$ cited_by_count: int 21
##   ..$ :List of 4
##   .. ..$ year          : int 2024
##   .. ..$ works_count   : int 2
##   .. ..$ oa_works_count: int 1
##   .. ..$ cited_by_count: int 23
##   ..$ :List of 4
##   .. ..$ year          : int 2023
##   .. ..$ works_count   : int 3
##   .. ..$ oa_works_count: int 2
##   .. ..$ cited_by_count: int 36
##   ..$ :List of 4
##   .. ..$ year          : int 2022
##   .. ..$ works_count   : int 3
##   .. ..$ oa_works_count: int 3
##   .. ..$ cited_by_count: int 20
##   ..$ :List of 4
##   .. ..$ year          : int 2021
##   .. ..$ works_count   : int 1
##   .. ..$ oa_works_count: int 1
##   .. ..$ cited_by_count: int 13
##   ..$ :List of 4
##   .. ..$ year          : int 2020
##   .. ..$ works_count   : int 3
##   .. ..$ oa_works_count: int 1
##   .. ..$ cited_by_count: int 8
##   ..$ :List of 4
##   .. ..$ year          : int 2019
##   .. ..$ works_count   : int 3
##   .. ..$ oa_works_count: int 2
##   .. ..$ cited_by_count: int 2
##   ..$ :List of 4
##   .. ..$ year          : int 2018
##   .. ..$ works_count   : int 1
##   .. ..$ oa_works_count: int 0
##   .. ..$ cited_by_count: int 0
##   ..$ :List of 4
##   .. ..$ year          : int 2016
##   .. ..$ works_count   : int 3
##   .. ..$ oa_works_count: int 0
##   .. ..$ cited_by_count: int 1
##  $ works_api_url            : chr "https://api.openalex.org/works?filter=author.id:A5009389179"
##  $ updated_date             : chr "2025-09-18T04:06:46.703634"
##  $ created_date             : chr "2023-07-21"
glimpse(lw_json, max.level = 1)
## List of 17
##  $ id                       : chr "https://openalex.org/A5009389179"
##  $ orcid                    : chr "https://orcid.org/0000-0001-9301-533X"
##  $ display_name             : chr "Lise Woensdregt"
##  $ display_name_alternatives:List of 1
##  $ works_count              : int 19
##  $ cited_by_count           : int 114
##  $ summary_stats            :List of 3
##  $ ids                      :List of 2
##  $ affiliations             :List of 4
##  $ last_known_institutions  :List of 1
##  $ topics                   :List of 21
##  $ topic_share              :List of 21
##  $ x_concepts               :List of 25
##  $ counts_by_year           :List of 9
##  $ works_api_url            : chr "https://api.openalex.org/works?filter=author.id:A5009389179"
##  $ updated_date             : chr "2025-09-18T04:06:46.703634"
##  $ created_date             : chr "2023-07-21"
lw__works_json <- fromJSON("https://api.openalex.org/works?page=1&filter=authorships.author.id:a5009389179,type:types/article", simplifyVector = FALSE)

# Later I want to make a table with the author names + affiliations, combined with mean citation index of those 5 works + 2_yr_meancitedness + h_index

# But for now I will use works_count and cited_by_count, so I will only use lw_json. Name, affiliation

lw_json$display_name 
## [1] "Lise Woensdregt"
lw_json$last_known_institutions$display_name
## NULL
df_lw <- lw_json %>%
    .$last_known_institutions %>%
    .[[1]] %>%
    .$display_name %>%
    discard(is_empty)

lw_json$works_count
## [1] 19
lw_json$cited_by_count
## [1] 114
name <- lw_json$display_name
current_university <- df_lw <- lw_json %>%
    .$last_known_institutions %>%
    .[[1]] %>%
    .$display_name %>%
    discard(is_empty)
workscount_ind <- lw_json$works_count
totalcitation_ind <- lw_json$cited_by_count
sociologists <- data.frame(name, current_university, workscount_ind, totalcitation_ind)
LS0tCnRpdGxlOiAibGFiNCIKYXV0aG9yOiAiR2hpc2xhaW5lIGRlIEdyb290IgpkYXRlOiAiMjAyNS0wOS0yNCIKLS0tCgotLS0tLQoKIyBQcm9vZiBvZiBjb25jZXB0CgpTaW5jZSBJIHdhbnQgdG8gdGVzdCB0aGUgZWZmZWN0IG9mIGRlcGFydG1lbnRhbCBwcmVzdGlnZSBpbiByZWxhdGlvbiB0byBpbmRpdmlkdWFsIHByZXN0aWdlIHdpdGhpbiB0aGUgY29sbGFib3JhdGlvbiBuZXR3b3JrIG9mIER1dGNoIHNvY2lvbG9naXN0cywgSSBmaXJzdCBoYWQgdG8gZ2V0IGRhdGEgb24gZGVwYXJ0bWVudHMgYW5kIG9uIGluZGl2aWR1YWwgc29jaW9sb2dpc3RzLiBJIGZvdW5kIG91dCB0aGF0IHRoZSBzdGFmZiB3ZWJwYWdlcyBkaWZmZXIgc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