Publications pull from orcid in script. Edits to reflect.
This commit is contained in:
parent
60dc4de757
commit
1ff7a20ebf
27
cv.Rmd
27
cv.Rmd
@ -3,7 +3,7 @@ name: Andreas
|
|||||||
surname: Gammelgaard Damsbo
|
surname: Gammelgaard Damsbo
|
||||||
position: "MD, PhD-student"
|
position: "MD, PhD-student"
|
||||||
pronouns: he/him
|
pronouns: he/him
|
||||||
address: "Danish Stroke Centre, Neurology, Aarhus University Hospital"
|
address: "Danish Stroke Centre, Neurology, Aarhus University Hospital, Denmark"
|
||||||
phone: "+45 2490 3612"
|
phone: "+45 2490 3612"
|
||||||
www: "andreas.gdamsbo.dk"
|
www: "andreas.gdamsbo.dk"
|
||||||
email: "andrlr@rm.dk"
|
email: "andrlr@rm.dk"
|
||||||
@ -23,6 +23,7 @@ library(tibble)
|
|||||||
library(rorcid)
|
library(rorcid)
|
||||||
|
|
||||||
orc_id <- "0000-0002-7559-1154"
|
orc_id <- "0000-0002-7559-1154"
|
||||||
|
get_new_pub_list <- FALSE
|
||||||
|
|
||||||
# Notes
|
# Notes
|
||||||
# https://stackoverflow.com/questions/63067088/syntax-for-publication-list-with-full-authors
|
# https://stackoverflow.com/questions/63067088/syntax-for-publication-list-with-full-authors
|
||||||
@ -57,27 +58,11 @@ tribble(
|
|||||||
```
|
```
|
||||||
|
|
||||||
```{r}
|
```{r}
|
||||||
library(dplyr)
|
if (get_new_pub_list | !file.exists("publications.bib")) {
|
||||||
library(rorcid)
|
source("orcid_pubs.R")
|
||||||
|
orcid_pubs(orc_id)
|
||||||
if (!file.exists("publications.bib")) {
|
|
||||||
works <- rorcid::orcid_works(orc_id)[[1]]
|
|
||||||
|
|
||||||
dois <-
|
|
||||||
Reduce(c, do.call(
|
|
||||||
cbind,
|
|
||||||
lapply(works$works$`external-ids.external-id`, function(a) {
|
|
||||||
if ("doi" %in% c(a[[1]])) {
|
|
||||||
s <- do.call(cbind, a)
|
|
||||||
s[, "external-id-normalized.value"][s[, "external-id-type"] == "doi"]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
)) |> na.omit() |> unique()
|
|
||||||
|
|
||||||
# rorcid::check_dois(dois)
|
|
||||||
RefManageR::GetBibEntryWithDOI(dois) |> rbibutils::writeBib("publications.bib")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bibliography_entries("publications.bib") %>%
|
bibliography_entries("publications.bib") %>%
|
||||||
arrange(desc(author$family), issued)
|
arrange(desc(issued))
|
||||||
```
|
```
|
||||||
|
17
orcid_pubs.R
Normal file
17
orcid_pubs.R
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
orcid_pubs <- function(orcid, path="publications.bib"){
|
||||||
|
dois <- Reduce(c,lapply(orcid,function(o){
|
||||||
|
works <- rorcid::orcid_works(orcid)[[1]]
|
||||||
|
|
||||||
|
Reduce(c, do.call(
|
||||||
|
cbind,
|
||||||
|
lapply(works$works$`external-ids.external-id`, function(a) {
|
||||||
|
if ("doi" %in% c(a[[1]])) {
|
||||||
|
s <- do.call(cbind, a)
|
||||||
|
s[, "external-id-normalized.value"][s[, "external-id-type"] == "doi"]
|
||||||
|
# Using the normalized values, a check has been run for bad DOIs
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)) |> na.omit() |> unique()
|
||||||
|
}))
|
||||||
|
|
||||||
|
RefManageR::GetBibEntryWithDOI(dois) |> rbibutils::writeBib(path)}
|
28
pubs.Rmd
28
pubs.Rmd
@ -23,16 +23,13 @@ library(tibble)
|
|||||||
library(rorcid)
|
library(rorcid)
|
||||||
|
|
||||||
orc_id <- "0000-0002-7559-1154"
|
orc_id <- "0000-0002-7559-1154"
|
||||||
|
scholar_id <- "Y80Xqc4AAAAJ"
|
||||||
# Notes
|
|
||||||
# https://stackoverflow.com/questions/63067088/syntax-for-publication-list-with-full-authors
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# Publications
|
# Publications
|
||||||
|
|
||||||
```{r}
|
```{r}
|
||||||
# library(scholar)
|
# library(scholar)
|
||||||
# scholar_id <- "Y80Xqc4AAAAJ"
|
|
||||||
# l <- get_profile(scholar_id)
|
# l <- get_profile(scholar_id)
|
||||||
# scholar::get_publications(scholar_id) |> writeLines("publications.bib")
|
# scholar::get_publications(scholar_id) |> writeLines("publications.bib")
|
||||||
# bibliography_entries("publications.bib") %>%
|
# bibliography_entries("publications.bib") %>%
|
||||||
@ -40,24 +37,11 @@ orc_id <- "0000-0002-7559-1154"
|
|||||||
```
|
```
|
||||||
|
|
||||||
```{r}
|
```{r}
|
||||||
library(dplyr)
|
if (get_new_pub_list | !file.exists("publications.bib")) {
|
||||||
library(rorcid)
|
source("orcid_pubs.R")
|
||||||
|
orcid_pubs(orc_id)
|
||||||
|
}
|
||||||
|
|
||||||
# works <- rorcid::orcid_works(orc_id)[[1]]
|
bibliography_entries("publications.bib") %>%
|
||||||
#
|
|
||||||
# edu <- do.call("rbind",
|
|
||||||
# rorcid::orcid_educations(orc_id)[[1]]
|
|
||||||
# )
|
|
||||||
|
|
||||||
# orc_id <- "0000-0002-7559-1154"
|
|
||||||
# pubs <- orcid_citations(orcid = orc_id, put_code=NULL)
|
|
||||||
#
|
|
||||||
# writeLines(pubs$citation, "publications.bib")
|
|
||||||
# bibliography_entries("pubs.bib") %>%
|
|
||||||
# arrange(desc(author$family), issued)
|
|
||||||
|
|
||||||
bibliography_entries("pubs.bib") %>%
|
|
||||||
arrange(desc(issued))
|
arrange(desc(issued))
|
||||||
|
|
||||||
## Currently not working; I think it is due to error in DOI lookup with latest article.
|
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user