structural changes
This commit is contained in:
parent
f72213f022
commit
faf4f38dac
5 changed files with 33 additions and 32 deletions
|
|
@ -4,6 +4,7 @@ library("tidyverse")
|
|||
library("xlsx")
|
||||
|
||||
source("config/config.R")
|
||||
source("functions.R")
|
||||
|
||||
#Übernimmt die Liste der zu durchsuchenden Excelfiles aus der Konfiguration
|
||||
file_list <- FIND_DISTINCTS_FILES
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ library("tidyverse")
|
|||
|
||||
#Konfiguration einbinden
|
||||
source("config/config.R")
|
||||
source("sparql.R")
|
||||
source("functions.R")
|
||||
|
||||
#Datenbank einlesen und doppelte entfernen
|
||||
inDB <- data.frame(get_current_geoera_lit_db()$citation)
|
||||
|
|
|
|||
|
|
@ -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]))+"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ library("tictoc")
|
|||
library("rlang")
|
||||
|
||||
#Funktionen & Konfiguration einbinden
|
||||
source("sparql.R")
|
||||
source("functions.R")
|
||||
source("config/config.R")
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -59,3 +59,32 @@ get_current_geoera_lit_db <- function() {
|
|||
|
||||
}
|
||||
|
||||
## 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue