-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added travis and codecoverage support.
- Loading branch information
Showing
8 changed files
with
135 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
^scythe\.Rproj$ | ||
^\.Rproj\.user$ | ||
^LICENSE\.md$ | ||
^\.travis\.yml$ | ||
^codecov\.yml$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r | ||
|
||
language: R | ||
cache: packages | ||
|
||
after_success: | ||
- Rscript -e 'covr::codecov()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
# Generated by roxygen2: fake comment so roxygen2 overwrites silently. | ||
exportPattern("^[^\\.]") | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
import(bib2df) | ||
import(curl) | ||
import(dataone) | ||
import(dplyr) | ||
import(jsonlite) | ||
import(rcrossref) | ||
import(xml2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
library(rcrossref) | ||
library(jsonlite) | ||
library(bib2df) | ||
#' @import rcrossref | ||
#' @import jsonlite | ||
#' @import bib2df | ||
write_citation_pairs <- function() { | ||
|
||
# manually generated citations list | ||
cit <- read.csv("DBO_citations/citationlist.csv", stringsAsFactors = F) | ||
|
||
# manually generated citations list | ||
cit <- read.csv("DBO_citations/citationlist.csv", stringsAsFactors = F) | ||
# write list of citations to bib format | ||
bib <- cr_cn(dois = cit$publicationDOI, format = "bibtex") | ||
writeLines(unlist(bib), "DBO_citations/all_citations.bib" ) | ||
|
||
# write list of citations to bib format | ||
bib <- cr_cn(dois = cit$publicationDOI, format = "bibtex") | ||
writeLines(unlist(bib), "DBO_citations/all_citations.bib" ) | ||
# import as a dataframe | ||
df <- bib2df("~/dataone-citations/DBO_citations/all_citations.bib") | ||
df$datasetID <- cit$datasetID | ||
|
||
# import as a dataframe | ||
df <- bib2df("~/dataone-citations/DBO_citations/all_citations.bib") | ||
df$datasetID <- cit$datasetID | ||
# rename for database ingest | ||
cit_full <- df %>% | ||
rename(target_id = datasetID, | ||
source_id = DOI, | ||
source_url = URL, | ||
origin = AUTHOR, | ||
title = TITLE, | ||
publisher = PUBLISHER, | ||
journal = JOURNAL, | ||
volume = VOLUME, | ||
page = PAGES, | ||
year_of_publishing = YEAR) %>% | ||
select(target_id, source_id, source_url, origin, title, publisher, journal, volume, page, year_of_publishing) %>% | ||
mutate(id = NA, report = NA, metadata = NA, link_publication_date = NA) %>% | ||
mutate(publisher = ifelse(publisher == "Elsevier {BV", "Elsevier", "Copernicus")) | ||
|
||
# rename for database ingest | ||
cit_full <- df %>% | ||
rename(target_id = datasetID, | ||
source_id = DOI, | ||
source_url = URL, | ||
origin = AUTHOR, | ||
title = TITLE, | ||
publisher = PUBLISHER, | ||
journal = JOURNAL, | ||
volume = VOLUME, | ||
page = PAGES, | ||
year_of_publishing = YEAR) %>% | ||
select(target_id, source_id, source_url, origin, title, publisher, journal, volume, page, year_of_publishing) %>% | ||
mutate(id = NA, report = NA, metadata = NA, link_publication_date = NA) %>% | ||
mutate(publisher = ifelse(publisher == "Elsevier {BV", "Elsevier", "Copernicus")) | ||
|
||
write_json(cit_full, "~/dataone-citations/DBO_citations/citations_export.json") | ||
write_json(cit_full, "~/dataone-citations/DBO_citations/citations_export.json") | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
comment: false | ||
|
||
coverage: | ||
status: | ||
project: | ||
default: | ||
target: auto | ||
threshold: 1% | ||
patch: | ||
default: | ||
target: auto | ||
threshold: 1% |