ropensci / aRxiv
1

2

3
# pull out error message, or return NULL
4
arxiv_error_message <-
5
function(listresult)
6
{
7 1
    nentries <- sum(names(listresult)=="entry")
8 1
    if(nentries == 1) { # one entry
9 1
        entry <- listresult[["entry"]]
10

11
        # single entry with Error as title and "arXiv api core" as author?
12 1
        if(all(c("title", "author", "summary") %in% names(entry)) &&
13 1
           entry$title == "Error" &&
14 1
           "name" %in% names(entry$author) && entry$author$name == "arXiv api core") {
15

16 1
            return(entry$summary)
17

18
        }
19

20
    }
21

22
    # ok; return NULL
23 1
    NULL
24
}

Read our documentation on viewing source code .

Loading