@@ -50,26 +50,26 @@ pubs <- function(whois, openalex_id){
5050 pub <- openalexR :: oa_fetch(entity = " works" ,
5151 author.id = openalex_id )
5252
53- pub_mod <- pub $ author %> %
54- lapply(. , function (x ) {x $ au_display_name %> % str_flatten(. , collapse = " , " )}) %> %
53+ pub_mod <- pub $ authorships %> %
54+ lapply(. , function (x ) {x $ display_name %> % str_flatten(. , collapse = " , " )}) %> %
5555 unlist() %> %
5656 tibble(authors = . ) %> %
5757 cbind(pub , . )
5858
5959
60- pub_mod <- pub_mod $ author %> %
60+ pub_mod <- pub_mod $ authorships %> %
6161 lapply(. , function (x ){
62- number <- x $ au_id %> % str_detect(openalex_id ) %> % which()
62+ number <- x $ id %> % str_detect(openalex_id ) %> % which()
6363 position <- x $ author_position [number ]
6464 }) %> %
6565 unlist(. ) %> %
6666 tibble(position = . ) %> %
6767 cbind(pub_mod , . )
6868
6969
70- pub_mod <- pub_mod $ author %> %
70+ pub_mod <- pub_mod $ authorships %> %
7171 lapply(. , function (x ){
72- number <- x $ au_id %> % str_detect(openalex_id ) %> % which(. )
72+ number <- x $ id %> % str_detect(openalex_id ) %> % which(. )
7373 corresponding <- x $ is_corresponding [number ]
7474 }) %> %
7575 unlist(. ) %> %
@@ -96,15 +96,15 @@ pubs <- function(whois, openalex_id){
9696 if_else(position == " middle" , " coauthor" , position ),
9797 if_else(corresponding == TRUE , " ,\n corresponding" , " " )
9898 )) %> %
99- select(title , authors , doi , publication_date , type , so , host_organization , authorship ) %> %
99+ select(title , authors , doi , publication_date , type , source_display_name , host_organization_name , authorship ) %> %
100100 drop_na(. , doi ) %> %
101101 mutate(doi = paste0(' <a target=_blank href=' , doi , ' >' , doi %> % str_remove(. , " https://doi.org/" ),' </a>' ),
102- journal = so %> % as.factor(),
103- publisher = host_organization %> % as.factor(),
102+ journal = source_display_name %> % as.factor(),
103+ publisher = host_organization_name %> % as.factor(),
104104 type = type %> % as.factor(),
105105 `publication date` = publication_date %> % as_date()
106106 ) %> %
107- select(! c(so , host_organization , publication_date )) %> %
107+ select(! c(source_display_name , host_organization_name , publication_date )) %> %
108108 arrange(desc(`publication date` )) %> %
109109 DT :: datatable(. , escape = F , extensions = ' Buttons' , options = list (dom = ' tp' , buttons = c(' copy' , ' csv' , ' excel' )))
110110}
0 commit comments