Skip to content

Commit

Permalink
Merge branch 'v2'
Browse files Browse the repository at this point in the history
  • Loading branch information
njahn82 committed Oct 2, 2017
2 parents e2bb8da + 46a1458 commit c08a6ca
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 74 deletions.
13 changes: 6 additions & 7 deletions R/oadoi_fetch.r
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#'
#' @param dois character vector, search by a single DOI or many DOIs.
#' A rate limit of 100k requests per day is suggested. If you need to access
#' more data, use the data dump \url{https://oadoi.org/api#dataset} instead.
#' more data, request the data dump \url{https://oadoi.org/api} instead.
#' @param email character vector, mandatory! oaDOI requires your email address,
#' so that they can track usage and notify you when something breaks.
#' Set email address in your `.Rprofile` file with
Expand All @@ -17,9 +17,8 @@
#' See \code{\link[plyr]{create_progress_bar}} for details
#' of each. By default, no progress bar is displayed.
#'
#' @return The result is a tibble with each row representing a publication and
#' and the following columns. Here are some fields returned by the API.
#' However, other fields can be added by oaDOI over time.
#' @return The result is a tibble with each row representing a publication.
#' Here are the returned columns and descriptions according to the API docu:
#'
#'
#' \tabular{ll}{
Expand Down Expand Up @@ -65,7 +64,7 @@
#'
#'
#' To unnest list-columns, you want to use tidyr's unnest function
#' \code{\link[tidyr]{unnest}} makes each element of the list its own row.
#' \code{\link[tidyr]{unnest}}.

#' @examples \dontrun{
#' oadoi_fetch("10.1038/nature12373", email = "name@example.com")
Expand All @@ -84,8 +83,8 @@ oadoi_fetch <-
if (length(dois) > api_limit)
stop(
"A rate limit of 100k requests per day is suggested.
If you need to access tomore data, use the data dump
https://oadoi.org/api#dataset instead",
If you need to access more data, request the data dump
https://oadoi.org/api instead",
.call = FALSE
)
# Call API for every DOI, and return results as tbl_df
Expand Down
5 changes: 2 additions & 3 deletions R/roadoi-package.r
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
#' information and full-text links from oaDOI.
#'
#' @section Contribute:
#' I would be very happy for people willing to contribute to this package.
#' It is important to keep in mind that oaDOI is still in early development,
#' which could affect the API and this client.
#' I would be very happy for people willing to contribute to this package. Use
#' GitHubs issue tracker for bug reporting and feature requests.
#'
#' @importFrom httr GET content modify_url user_agent add_headers status_code timeout
#' @importFrom jsonlite fromJSON
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ roadoi::oadoi_fetch(dois = c("10.1038/ng.3260", "10.1093/nar/gkr1047"),
email = "name@example.com")
```

There are no API restrictions. However, providing an email address is required and a rate limit of 100k is implemented If you need to access more data, use the data dump <https://oadoi.org/api#dataset> instead.
There are no API restrictions. However, providing an email address is required and a rate limit of 100k is suggested. If you need to access more data, ask for the data dump <https://oadoi.org/api> instead.

### RStudio Addin

Expand Down
102 changes: 52 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ roadoi::oadoi_fetch(dois = c("10.1038/ng.3260", "10.1093/nar/gkr1047"),
#> # year <chr>, updated <chr>, non_compliant <list>
```

There are no API restrictions. However, providing an email address is required and a rate limit of 100k is implemented If you need to access more data, use the data dump <https://oadoi.org/api#dataset> instead.
There are no API restrictions. However, providing an email address is required and a rate limit of 100k is suggested. If you need to access more data, ask for the data dump <https://oadoi.org/api> instead.

### RStudio Addin

Expand Down Expand Up @@ -129,11 +129,11 @@ that contain useful metadata about the OA sources found by oaDOI. These are

**Column**|**Description**
|:------------|:----------------------------------------------
evidence`|How the OA location was found and is characterized by oaDOI?
host_type`|OA full-text provided by `publisher` or `repository`.
license`|The license under which this copy is published
url`|The URL where you can find this OA copy.
versions`|The content version accessible at this location following the DRIVER 2.0 Guidelines evidence (<https://wiki.surfnet.nl/display/DRIVERguidelines/DRIVER-VERSION+Mappings>)
`evidence`|How the OA location was found and is characterized by oaDOI?
`host_type`|OA full-text provided by `publisher` or `repository`.
`license`|The license under which this copy is published
`url`|The URL where you can find this OA copy.
`versions`|The content version accessible at this location following the DRIVER 2.0 Guidelines (<https://wiki.surfnet.nl/display/DRIVERguidelines/DRIVER-VERSION+Mappings>)

You can [simplify these list-columns in at least two ways](http://r4ds.had.co.nz/many-models.html#simplifying-list-columns).

Expand Down Expand Up @@ -244,27 +244,28 @@ random_dois <- rcrossref::cr_r(sample = 100) %>%
.$data
random_dois
#> # A tibble: 100 x 35
#> alternative.id container.title
#> <chr> <chr>
#> 1 Southern Medical Journal
#> 2 10.1021/cm000092r Chemistry of Materials
#> 3 Overcoming Anxiety for Dummies®
#> 4 S0006291X72800251 Biochemical and Biophysical Research Communications
#> 5 Acta Theriologica
#> 6 Virginia Law Review
#> 7 0378475489900542 Mathematics and Computers in Simulation
#> 8 S0169433212014869 Applied Surface Science
#> 9 S0922156500002120 Leiden Journal of International Law
#> 10 S000299041934058166 Bulletin of the American Mathematical Society
#> # ... with 90 more rows, and 33 more variables: created <chr>,
#> # deposited <chr>, DOI <chr>, funder <list>, indexed <chr>, ISBN <chr>,
#> # ISSN <chr>, issue <chr>, issued <chr>, link <list>, member <chr>,
#> # page <chr>, prefix <chr>, publisher <chr>, reference.count <chr>,
#> # score <chr>, source <chr>, subject <chr>, subtitle <chr>, title <chr>,
#> # type <chr>, URL <chr>, volume <chr>, assertion <list>, author <list>,
#> # `clinical-trial-number` <list>, license_date <chr>, license_URL <chr>,
#> # license_delay.in.days <chr>, license_content.version <chr>,
#> # update.policy <chr>, abstract <chr>, archive <chr>
#> alternative.id
#> <chr>
#> 1
#> 2
#> 3
#> 4 10.1080/10739149908085828
#> 5
#> 6
#> 7
#> 8 S0266462300004918
#> 9
#> 10 BF00202270
#> # ... with 90 more rows, and 34 more variables: container.title <chr>,
#> # created <chr>, deposited <chr>, DOI <chr>, funder <list>,
#> # indexed <chr>, ISBN <chr>, ISSN <chr>, issue <chr>, issued <chr>,
#> # link <list>, member <chr>, page <chr>, prefix <chr>, publisher <chr>,
#> # reference.count <chr>, score <chr>, source <chr>, subject <chr>,
#> # title <chr>, type <chr>, URL <chr>, assertion <list>, author <list>,
#> # `clinical-trial-number` <list>, volume <chr>, archive <chr>,
#> # license_date <chr>, license_URL <chr>, license_delay.in.days <chr>,
#> # license_content.version <chr>, subtitle <chr>, abstract <chr>,
#> # update.policy <chr>
```

Let's see when these random publications were published
Expand All @@ -281,16 +282,16 @@ random_dois %>%
#> # A tibble: 49 x 2
#> issued pubs
#> <dbl> <int>
#> 1 2010 5
#> 2 2013 5
#> 3 NA 5
#> 4 1999 4
#> 5 2004 4
#> 6 2006 4
#> 7 2007 4
#> 8 2009 4
#> 9 2011 4
#> 10 2014 4
#> 1 NA 12
#> 2 2003 5
#> 3 2006 4
#> 4 2012 4
#> 5 2014 4
#> 6 1985 3
#> 7 1993 3
#> 8 1994 3
#> 9 1998 3
#> 10 2007 3
#> # ... with 39 more rows
```

Expand All @@ -305,13 +306,13 @@ random_dois %>%
#> # A tibble: 7 x 2
#> type pubs
#> <chr> <int>
#> 1 journal-article 78
#> 1 journal-article 72
#> 2 book-chapter 8
#> 3 proceedings-article 7
#> 4 component 3
#> 5 journal-issue 2
#> 6 monograph 1
#> 7 other 1
#> 3 component 7
#> 4 proceedings-article 7
#> 5 dataset 3
#> 6 reference-entry 2
#> 7 journal-issue 1
```

#### Calling oaDOI.org
Expand Down Expand Up @@ -352,8 +353,8 @@ my_df %>%

|is_oa | Articles| Proportion|
|:-----|--------:|----------:|
|FALSE | 82| 0.82|
|TRUE | 18| 0.18|
|FALSE | 80| 0.8|
|TRUE | 20| 0.2|

How did oaDOI find those Open Access full-texts, which were characterized as best matches, and how are these OA types distributed over publication types?

Expand All @@ -372,11 +373,12 @@ my_df %>%

|evidence |type | Articles|
|:-------------------------------|:-------------------|--------:|
|hybrid (via free pdf) |journal-article | 7|
|oa repository (via BASE) |journal-article | 7|
|oa repository (via BASE) |proceedings-article | 2|
|hybrid (via crossref license) |journal-article | 1|
|oa journal (via publisher name) |component | 1|
|hybrid (via free pdf) |journal-article | 8|
|oa journal (via publisher name) |component | 5|
|oa repository (via BASE) |journal-article | 3|
|hybrid (via crossref license) |journal-article | 2|
|oa journal (via publisher name) |journal-article | 1|
|oa repository (via BASE) |proceedings-article | 1|

#### More examples

Expand Down
9 changes: 4 additions & 5 deletions man/oadoi_fetch.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions man/roadoi-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions vignettes/intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ that contain useful metadata about the OA sources found by oaDOI. These are

**Column**|**Description**
|:------------|:----------------------------------------------
evidence`|How the OA location was found and is characterized by oaDOI?
host_type`|OA full-text provided by `publisher` or `repository`.
license`|The license under which this copy is published
url`|The URL where you can find this OA copy.
versions`|The content version accessible at this location following the DRIVER 2.0 Guidelines evidence (<https://wiki.surfnet.nl/display/DRIVERguidelines/DRIVER-VERSION+Mappings>)
`evidence`|How the OA location was found and is characterized by oaDOI?
`host_type`|OA full-text provided by `publisher` or `repository`.
`license`|The license under which this copy is published
`url`|The URL where you can find this OA copy.
`versions`|The content version accessible at this location following the DRIVER 2.0 Guidelines (<https://wiki.surfnet.nl/display/DRIVERguidelines/DRIVER-VERSION+Mappings>)

You can [simplify these list-columns in at least two ways](http://r4ds.had.co.nz/many-models.html#simplifying-list-columns).

Expand Down

0 comments on commit c08a6ca

Please sign in to comment.