Skip to content

Commit

Permalink
added CITATION
Browse files Browse the repository at this point in the history
  • Loading branch information
tscheypidi committed Jan 26, 2018
1 parent ac2e937 commit 92e70bf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: magclass
Type: Package
Title: Data Class and Tools for Handling Spatial-Temporal Data
Version: 4.74.1
Date: 2018-01-25
Version: 4.75.0
Date: 2018-01-26
Authors@R: c(person("Jan Philipp", "Dietrich", email = "[email protected]", role = c("aut","cre")),
person("Benjamin Leon", "Bodirsky", email = "[email protected]", role = "aut"),
person("Markus", "Bonsch", role = "aut"),
Expand Down
18 changes: 18 additions & 0 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@


citation_doi <- function(package) {
cit <- citation(package, auto=TRUE)
if(!is.null(cit$note)) {
tmp <- strsplit(cit$note,", ")[[1]]
urls <- grep("http",tmp,value=TRUE)
cit$note <- paste0(grep("http",tmp,value=TRUE, invert=TRUE), collapse=", ")
cit$doi <- gsub("\n","",gsub("https://doi.org/","",grep("doi.org",urls,fixed=TRUE, value=TRUE), fixed=TRUE))
cit$url <- grep("doi.org",urls,fixed=TRUE, value=TRUE, invert=TRUE)
if(cit$note=="") cit$note <- paste("R package version",packageDescription(package)$Version)
if(!length(cit$url)) cit$url <- NULL
if(!length(cit$doi)) cit$doi <- NULL
}
return(cit)
}

citation_doi("magclass")

0 comments on commit 92e70bf

Please sign in to comment.