structural changes
This commit is contained in:
parent
f72213f022
commit
faf4f38dac
5 changed files with 33 additions and 32 deletions
|
|
@ -4,36 +4,7 @@ library("writexl")
|
|||
|
||||
#Konfiguration einbinden
|
||||
source("config/config.R")
|
||||
|
||||
## nicht meine Funktion - eingebunden von https://rdrr.io/cran/retractcheck/src/R/utils.R
|
||||
find_doi <- function (strings) {
|
||||
regex <- '10\\.\\d{4,9}/[-._;()/:A-Z0-9]+'
|
||||
doiLoc <- gregexpr(text = strings, pattern = regex, perl = TRUE, ignore.case = TRUE)
|
||||
|
||||
i <- 1
|
||||
res <- NULL
|
||||
|
||||
# for each in the doiLoc list check whether match (!-1)
|
||||
for ( i in 1:length(doiLoc) ) {
|
||||
if ( doiLoc[[i]][1] != -1 ) {
|
||||
for ( j in 1:length(doiLoc[[i]]) ) {
|
||||
res <- c(res,
|
||||
substring(strings[i], doiLoc[[i]][j], doiLoc[[i]][j] + attr(doiLoc[[i]], 'match.length')[j] - 1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(res)
|
||||
}
|
||||
|
||||
|
||||
## nicht meine Funktion - eingebunden von https://stackoverflow.com/questions/52911812/check-if-url-exists-in-r
|
||||
valid_url <- function(url_in,t=2){
|
||||
con <- url(url_in)
|
||||
check <- suppressWarnings(try(open.connection(con,open="rt",timeout=t),silent=T)[1])
|
||||
suppressWarnings(try(close.connection(con),silent=T))
|
||||
ifelse(is.null(check),TRUE,FALSE)
|
||||
}
|
||||
source("functions.R")
|
||||
|
||||
|
||||
url_pattern <- "http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue