Skip to content

Commit

Permalink
0.0.1.4 initial
Browse files Browse the repository at this point in the history
  • Loading branch information
pgomba committed Aug 17, 2024
1 parent 77fa3f4 commit ff39b5d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ VignetteBuilder: knitr
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
LazyData: true
Imports:
dplyr,
Expand Down
23 changes: 21 additions & 2 deletions R/special_issue_find.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#' Returns a vector of URLs with special issues from target journal
#' @param journal MDPI journal code
#' @param type "closed", "open" or "all" special issues. "closed" by default.
#' @param years A vector containing special issues closure dates to limit the search to certain years
#' @import magrittr rvest dplyr
#' @export special_issue_find
#' @return A vector.
Expand All @@ -10,7 +11,7 @@
#' }


special_issue_find <- function(journal,type="closed") {
special_issue_find <- function(journal,type="closed",years=NULL) {

si_url<-data.frame()

Expand All @@ -30,6 +31,15 @@ special_issue_find <- function(journal,type="closed") {
mutate(full_url=paste0("https://www.mdpi.com",.))%>%
distinct()

year<-data%>%
html_nodes("strong:nth-child(3)")%>%
html_text2()%>%
gsub(".* ","",.)%>%
as.data.frame()%>%
rename(year=1)

links<-cbind(links,year)

si_url<-bind_rows(si_url,links)

if (nrow(si_url)!=nrow(distinct(si_url))){
Expand All @@ -40,7 +50,16 @@ special_issue_find <- function(journal,type="closed") {

}

special_issues<-si_url$full_url
if (is.null(years)) {

special_issues<-si_url$full_url

}else{
special_issues<-si_url%>%
filter(year %in% years)

special_issues<-special_issues$full_url
}

special_issues

Expand Down

0 comments on commit ff39b5d

Please sign in to comment.