Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nealhaddaway committed Jan 24, 2022
1 parent bbcbcb7 commit 9588e23
Show file tree
Hide file tree
Showing 9 changed files with 624 additions and 17 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
^.*\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: citationchaser
Title: Perform forward and backwards chasing in evidence syntheses
Version: 0.0.3
Authors@R:c(
Version: 0.0.4
Authors@R: c(
person(given = "Neal",
family = "Haddaway",
role = c("aut", "cre"),
Expand All @@ -26,9 +26,10 @@ Description: In searching for research articles, we often want to
Academic Graph and CORE; 'https://www.lens.org').
Imports:
dplyr,
expss,
httr,
jsonlite,
maditr,
MESS,
networkD3,
scales,
tibble,
Expand All @@ -38,7 +39,7 @@ Suggests:
knitr,
rmarkdown
VignetteBuilder: knitr
License: GPL + file LICENSE
License: GPL (>= 3) + file LICENSE
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
Expand Down
595 changes: 595 additions & 0 deletions LICENSE.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

export(get_citation)
export(get_refs)
importFrom(MESS,cumsumbinning)
importFrom(data.table,data.table)
importFrom(dplyr,bind_rows)
importFrom(dplyr,group_split)
importFrom(dplyr,mutate)
importFrom(expss,vlookup)
importFrom(httr,POST)
importFrom(httr,add_headers)
importFrom(httr,content)
importFrom(jsonlite,fromJSON)
importFrom(scales,comma)
importFrom(maditr,vlookup)
importFrom(tibble,tibble)
importFrom(utils,write.table)
12 changes: 8 additions & 4 deletions R/get_refs.R
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,10 @@ getLENSData <- function(token, query){

#' Find citation based on identifier
#'
#' @description
#' @description This function takes a list of articles in the form of established
#' identifiers (e.g. digital object identifiers) and sends a request to the
#' lens.org API to obtain full citation information from the Lens database for
#' all sought articles.
#' @param article_list List of article identifiers for which the reference
#' lists will be returned. Must be a list/vector of identifiers, e.g.
#' '"10.1186/s13750-018-0126-2" "10.1002/jrsm.1378"'.
Expand All @@ -579,13 +582,14 @@ getLENSData <- function(token, query){
#' applying for scholarly API access and creating a token once approved. See
#' 'https://www.lens.org/lens/user/subscriptions#scholar' for further details.
#' @return A dataframe containing the matching citation from Lens.org.
#' @importFrom expss vlookup
#' @importFrom maditr vlookup
#' @importFrom httr content
#' @importFrom jsonlite fromJSON
#' @importFrom data.table data.table
#' @examples
#' \dontrun{
#' article_list <- c("10.1007/978-3-642-37048-9_13", "10.1111/sum.12030", "10.5194/bg-13-3619-2016", "10.1016/j.agee.2012.09.006")
#' article_list <- c("10.1007/978-3-642-37048-9_13", "10.1111/sum.12030",
#' "10.5194/bg-13-3619-2016", "10.1016/j.agee.2012.09.006")
#' results <- get_citation(article_list)
#' articles <- results$display
#' }
Expand Down Expand Up @@ -648,7 +652,7 @@ get_citation <- function(article_list,
issn <- record_list[["data"]][["source"]][["issn"]]
doi <- unlist(lapply(record_list[["data"]][["external_ids"]], function(ch) maditr::vlookup('doi', ch, result_column = 'value', lookup_column = 'type')))

article_table <- data.table(authors = authors,
article_table <- data.table::data.table(authors = authors,
year = year,
title = title,
source_title = source_title,
Expand Down
1 change: 1 addition & 0 deletions R/globals.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
utils::globalVariables(c("export_group"))
Binary file modified inst/.DS_Store
Binary file not shown.
11 changes: 6 additions & 5 deletions man/get_citation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions man/get_refs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9588e23

Please sign in to comment.