diff --git a/README.md b/README.md index b85a4be..3b76384 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ pull_incites(uts) #> ut article_type tot_cites journal_expected_citations #> 1.1 WOS:000272877700013 AA 1 3.4 #> 1.2 WOS:000272366800025 AA 4 4.3 -#> 1.3 WOS:000272272000015 AA 3 9.0 +#> 1.3 WOS:000272272000015 AA 3 9.1 #> journal_act_exp_citations impact_factor avg_expected_rate percentile #> 1.1 0.29 0.49 20 87 #> 1.2 0.93 0.85 20 63 @@ -135,33 +135,33 @@ wos <- pull_wos('TS = ("dog welfare")', sid = sid) # Download InCites data head(pull_incites(wos$publication$ut)) #> ut article_type tot_cites journal_expected_citations -#> 1.1 WOS:A1996VH04300002 AA 19 30.22 -#> 1.2 WOS:000438259600009 AA 1 1.12 -#> 1.3 WOS:000438259600004 AA 1 1.12 -#> 1.4 WOS:000436270600004 AA 0 0.26 -#> 1.5 WOS:000435128900013 R 3 2.00 -#> 1.6 WOS:000432234000011 AA 0 0.14 +#> 1.1 WOS:A1996VH04300002 AA 19 30.308 +#> 1.2 WOS:000439855300030 L 0 0.068 +#> 1.3 WOS:000438259600009 AA 1 1.186 +#> 1.4 WOS:000438259600004 AA 1 1.186 +#> 1.5 WOS:000436270600004 AA 1 0.321 +#> 1.6 WOS:000435128900013 R 3 2.000 #> journal_act_exp_citations impact_factor avg_expected_rate percentile -#> 1.1 0.63 1.5 19.15 22.8 -#> 1.2 0.90 1.6 0.17 10.9 -#> 1.3 0.90 1.6 0.17 10.9 -#> 1.4 0.00 1.7 0.13 100.0 -#> 1.5 1.50 1.6 0.32 1.2 -#> 1.6 0.00 1.5 0.15 100.0 +#> 1.1 0.63 1.5 19.20 22.8 +#> 1.2 0.00 2.0 0.11 100.0 +#> 1.3 0.84 1.6 0.21 12.5 +#> 1.4 0.84 1.6 0.21 12.5 +#> 1.5 3.12 1.7 0.15 11.5 +#> 1.6 1.50 1.6 0.40 1.5 #> nci esi_most_cited_article hot_paper is_international_collab #> 1.1 0.99 FALSE FALSE FALSE -#> 1.2 5.72 FALSE FALSE FALSE -#> 1.3 5.72 FALSE FALSE FALSE -#> 1.4 0.00 FALSE FALSE FALSE -#> 1.5 9.35 FALSE FALSE TRUE -#> 1.6 0.00 FALSE FALSE FALSE +#> 1.2 0.00 FALSE FALSE FALSE +#> 1.3 4.74 FALSE FALSE FALSE +#> 1.4 4.74 FALSE FALSE FALSE +#> 1.5 6.46 FALSE FALSE FALSE +#> 1.6 7.46 FALSE FALSE TRUE #> is_institution_collab is_industry_collab oa_flag #> 1.1 FALSE FALSE FALSE #> 1.2 FALSE FALSE FALSE #> 1.3 FALSE FALSE FALSE -#> 1.4 FALSE FALSE TRUE -#> 1.5 TRUE FALSE FALSE -#> 1.6 FALSE FALSE FALSE +#> 1.4 FALSE FALSE FALSE +#> 1.5 FALSE FALSE TRUE +#> 1.6 TRUE FALSE FALSE ``` Learning more diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index a673640..306d87e 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -60,7 +60,7 @@ wosr - 0.2.0 + 0.3.0 diff --git a/docs/articles/faqs.html b/docs/articles/faqs.html index 9e09ea3..cb44cf4 100644 --- a/docs/articles/faqs.html +++ b/docs/articles/faqs.html @@ -8,15 +8,18 @@ Frequently asked questions • wosr - - + + + + + -
+
-
-
+
+
+ + + + +
-

Why does the WoS API sometimes return a different number of records than the WoS web interface?

@@ -99,8 +108,8 @@

data <- pull_wos("TS = \"dog welfare\"") data$author %>% - left_join(data$author_address, by = c("ut", "author_no")) %>% - left_join(data$address, by = c("ut", "addr_no"))

+ left_join(data$author_address, by = c("ut", "author_no")) %>% + left_join(data$address, by = c("ut", "addr_no"))

@@ -124,7 +133,6 @@

  1. To accommodate this limit, pull_incites() sleeps for a given amount of time (determined by how many times it has received a throttling error for the request it is trying to make) before retrying the request.

-

@@ -139,11 +147,13 @@

-

Site built with pkgdown.

+

Site built with pkgdown.

+ + diff --git a/docs/articles/getting-started.html b/docs/articles/getting-started.html index 828c1ea..5f935e0 100644 --- a/docs/articles/getting-started.html +++ b/docs/articles/getting-started.html @@ -8,15 +8,18 @@ Getting started • wosr - - + + + + + -
+
-
-
+
+
+ + + + +
-
  1. The first step is to open up a session with the WoS API. auth() will authenticate your credentials with the the API’s server and return a session ID (SID).
@@ -145,92 +154,143 @@

Getting started

top_jscs <- data$jsc %>% - group_by(jsc) %>% - count() %>% - arrange(desc(n)) %>% + group_by(jsc) %>% + count() %>% + arrange(desc(n)) %>% head() -top_jscs
-
- -
+top_jscs +#> # A tibble: 6 x 2 +#> # Groups: jsc [6] +#> jsc n +#> <chr> <int> +#> 1 Veterinary Sciences 69 +#> 2 Zoology 9 +#> 3 Agriculture, Dairy & Animal Science 6 +#> 4 Behavioral Sciences 4 +#> 5 Sociology 4 +#> 6 History & Philosophy of Science 3
data$jsc %>% 
-  inner_join(top_jscs, by = "jsc") %>% 
-  inner_join(data$publication, by = "ut") %>% 
-  select(title) %>% 
-  distinct() %>% 
-  head()
-
- -
+ inner_join(top_jscs, by = "jsc") %>% + inner_join(data$publication, by = "ut") %>% + select(title) %>% + distinct() %>% + head() +#> title +#> 1 ANIMAL WELFARE Brachycephalic dog breeds +#> 2 Reporting animal welfare concerns +#> 3 Sled dog racing and animal welfare aspects +#> 4 Animal welfare activist injured while aiding dog +#> 5 Travel with dogs - Aspects of animal welfare +#> 6 ANIMAL WELFARE Welsh government confirms commitment to dog welfare law
  • Which publications have “cat” in their abstracts, who are the authors on those publications, and which organizations are those authors from?
cat_pubs <- 
   data$publication %>% 
-    filter(grepl("\\bcat\\b", abstract, ignore.case = TRUE)) %>% 
-    select(ut)
-
-cat_pubs
-
- -
+ filter(grepl("\\bcat\\b", abstract, ignore.case = TRUE)) %>% + select(ut) + +cat_pubs +#> ut +#> 1 WOS:000256104000004 +#> 2 WOS:000346849200008 +#> 3 WOS:000441200900005 +#> 4 WOS:000317556100002 +#> 5 WOS:000282006600007
cat_authors <- 
   data$author %>% 
-    semi_join(cat_pubs, by = "ut") %>% 
-    select(ut, author_no, display_name)
-
-cat_authors
-
- -
+ semi_join(cat_pubs, by = "ut") %>% + select(ut, author_no, display_name) + +cat_authors +#> ut author_no display_name +#> 1 WOS:000256104000004 1 Steiger, A. +#> 2 WOS:000256104000004 2 Stucki, E. +#> 3 WOS:000256104000004 3 Peyer, N. +#> 4 WOS:000256104000004 4 Keller, P. +#> 5 WOS:000346849200008 1 Beausoleil, N. J. +#> 6 WOS:000346849200008 2 Mellor, D. J. +#> 7 WOS:000441200900005 1 Donnellan, Laura +#> 8 WOS:000317556100002 1 Gueguen, Nicolas +#> 9 WOS:000282006600007 1 Farnworth, M. J. +#> 10 WOS:000282006600007 2 Campbell, J. +#> 11 WOS:000282006600007 3 Adams, N. J.
cat_authors %>% 
-  inner_join(data$author_address, by = c("ut", "author_no")) %>% 
-  inner_join(data$address, by = c("ut", "addr_no")) %>% 
-  select(ut, author_no, display_name, org)
-
- -
+ inner_join(data$author_address, by = c("ut", "author_no")) %>% + inner_join(data$address, by = c("ut", "addr_no")) %>% + select(ut, author_no, display_name, org) +#> ut author_no display_name org +#> 1 WOS:000256104000004 1 Steiger, A. Univ Bern +#> 2 WOS:000256104000004 2 Stucki, E. Bundesamt Vet +#> 3 WOS:000256104000004 3 Peyer, N. Bundesamt Vet +#> 4 WOS:000346849200008 1 Beausoleil, N. J. Massey Univ +#> 5 WOS:000346849200008 2 Mellor, D. J. Massey Univ +#> 6 WOS:000441200900005 1 Donnellan, Laura Univ Limerick +#> 7 WOS:000282006600007 1 Farnworth, M. J. Unitec Inst Technol +#> 8 WOS:000282006600007 2 Campbell, J. Unitec Inst Technol +#> 9 WOS:000282006600007 3 Adams, N. J. Unitec Inst Technol
data$grant %>% 
-  inner_join(data$publication, by = "ut") %>% 
-  select(grant_agency, ut, tot_cites) %>% 
-  distinct() %>% 
-  arrange(desc(tot_cites)) %>% 
-  head()
-
- -
+ inner_join(data$publication, by = "ut") %>% + select(grant_agency, ut, tot_cites) %>% + distinct() %>% + arrange(desc(tot_cites)) %>% + head() +#> grant_agency +#> 1 Ontario Graduate Scholarship +#> 2 NSERC postgraduate scholarship +#> 3 Animal Welfare Science and Bioethics Centre, Massey University +#> 4 United States National Science Foundation Division of Social and Economic Sciences +#> 5 National Science Foundation, Science, Technology, and Society program +#> 6 Intramural NIH HHS +#> ut tot_cites +#> 1 WOS:000266414200001 80 +#> 2 WOS:000266414200001 80 +#> 3 WOS:000346849200008 25 +#> 4 WOS:000376588600097 21 +#> 5 WOS:000376588600097 21 +#> 6 WOS:000250058400056 21
  1. Download more detailed citation data (from the InCites API) for the top-cited publications
top_100_pubs <- 
   data$publication %>% 
-    arrange(desc(tot_cites)) %>% 
-    slice(1:100) %>% 
+    arrange(desc(tot_cites)) %>% 
+    slice(1:100) %>% 
     .$ut
 
 head(pull_incites(top_100_pubs, key = "your_incites_key"))
-
- -
- +
#>                      ut article_type tot_cites journal_expected_citations
+#> 1.1 WOS:A1997YD63900007           AA        12                      30.50
+#> 1.2 WOS:A1994PU81000001           AA         1                       3.06
+#> 1.3 WOS:A1993KW33000003           AA         9                       2.39
+#> 1.4 WOS:A1993KT16900015            E         0                       0.53
+#> 1.5 WOS:A1993KR46800009           AA         6                       5.22
+#> 1.6 WOS:A1990BS37S00006            P         1                         NA
+#>     journal_act_exp_citations impact_factor avg_expected_rate percentile
+#> 1.1                      0.39         1.573              17.0         34
+#> 1.2                      0.33         0.043              14.2         84
+#> 1.3                      3.76        -1.000              14.2         45
+#> 1.4                      0.00        -1.000               1.2        100
+#> 1.5                      1.15        -1.000              14.2         54
+#> 1.6                        NA        -1.000               2.2         26
+#>      nci esi_most_cited_article hot_paper is_international_collab
+#> 1.1 0.70                  FALSE     FALSE                   FALSE
+#> 1.2 0.07                  FALSE     FALSE                   FALSE
+#> 1.3 0.64                  FALSE     FALSE                   FALSE
+#> 1.4 0.00                  FALSE     FALSE                   FALSE
+#> 1.5 0.42                  FALSE     FALSE                   FALSE
+#> 1.6 0.45                  FALSE     FALSE                   FALSE
+#>     is_institution_collab is_industry_collab oa_flag
+#> 1.1                 FALSE              FALSE   FALSE
+#> 1.2                 FALSE              FALSE   FALSE
+#> 1.3                 FALSE              FALSE   FALSE
+#> 1.4                 FALSE              FALSE   FALSE
+#> 1.5                 FALSE              FALSE   FALSE
+#> 1.6                 FALSE              FALSE   FALSE
-

Site built with pkgdown.

+

Site built with pkgdown.

+ + diff --git a/docs/articles/index.html b/docs/articles/index.html index de1d013..65331ed 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -18,13 +18,24 @@ + + + + + - + + + + + + + @@ -37,7 +48,7 @@ -
+
@@ -81,12 +97,12 @@ - -
-
+
+ +

All vignettes

@@ -105,11 +121,14 @@

All vignettes

-

Site built with pkgdown.

+

Site built with pkgdown.

+ + + diff --git a/docs/authors.html b/docs/authors.html index f9d1651..8cea14b 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -18,13 +18,24 @@ + + + + + - + + + + + + + @@ -47,8 +58,12 @@ - wosr + + wosr + 0.3.0 +
+
@@ -81,15 +97,15 @@ -
-
+
+
  • -

    Christopher Baker. Author, maintainer. +

    Christopher Baker. Author, maintainer.

@@ -105,11 +121,14 @@

Authors

-

Site built with pkgdown.

+

Site built with pkgdown.

+ + + diff --git a/docs/index.html b/docs/index.html index abdf827..b3fcb22 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,15 +8,21 @@ Clients to the 'Web of Science' and 'InCites' APIs • wosr - - + + + + + -
+
-
-
+
+
-


@@ -150,12 +158,23 @@

uts <- c("000272272000015", "000272366800025", "000272877700013") # Download InCites data for those UTs -pull_incites(uts)

-
- -
+pull_incites(uts) +#> ut article_type tot_cites journal_expected_citations +#> 1.1 WOS:000272877700013 AA 1 3.412784 +#> 1.2 WOS:000272366800025 AA 4 4.310413 +#> 1.3 WOS:000272272000015 AA 3 9.124272 +#> journal_act_exp_citations impact_factor avg_expected_rate percentile +#> 1.1 0.29 0.493 20.2986 87.45 +#> 1.2 0.93 0.847 20.2986 62.76 +#> 1.3 0.33 1.902 20.2986 69.44 +#> nci esi_most_cited_article hot_paper is_international_collab +#> 1.1 0.05 FALSE FALSE FALSE +#> 1.2 0.20 FALSE FALSE FALSE +#> 1.3 0.15 FALSE FALSE FALSE +#> is_institution_collab is_industry_collab oa_flag +#> 1.1 FALSE FALSE FALSE +#> 1.2 FALSE FALSE FALSE +#> 1.3 FALSE FALSE FALSE

@@ -164,33 +183,65 @@

wos <- pull_wos('TS = ("dog welfare")', sid = sid) # Download InCites data -head(pull_incites(wos$publication$ut))

-
- -
-
+head(pull_incites(wos$publication$ut)) +#> ut article_type tot_cites journal_expected_citations +#> 1.1 WOS:A1996VH04300002 AA 19 30.308411 +#> 1.2 WOS:000439855300030 L 0 0.067797 +#> 1.3 WOS:000438259600009 AA 1 1.186047 +#> 1.4 WOS:000438259600004 AA 1 1.186047 +#> 1.5 WOS:000436270600004 AA 1 0.320755 +#> 1.6 WOS:000435128900013 R 3 2.000000 +#> journal_act_exp_citations impact_factor avg_expected_rate percentile +#> 1.1 0.63 1.548 19.2034 22.84 +#> 1.2 0.00 2.050 0.1092 100.00 +#> 1.3 0.84 1.554 0.2110 12.51 +#> 1.4 0.84 1.554 0.2110 12.51 +#> 1.5 3.12 1.654 0.1547 11.54 +#> 1.6 1.50 1.554 0.4019 1.50 +#> nci esi_most_cited_article hot_paper is_international_collab +#> 1.1 0.99 FALSE FALSE FALSE +#> 1.2 0.00 FALSE FALSE FALSE +#> 1.3 4.74 FALSE FALSE FALSE +#> 1.4 4.74 FALSE FALSE FALSE +#> 1.5 6.46 FALSE FALSE FALSE +#> 1.6 7.46 FALSE FALSE TRUE +#> is_institution_collab is_industry_collab oa_flag +#> 1.1 FALSE FALSE FALSE +#> 1.2 FALSE FALSE FALSE +#> 1.3 FALSE FALSE FALSE +#> 1.4 FALSE FALSE FALSE +#> 1.5 FALSE FALSE TRUE +#> 1.6 TRUE FALSE FALSE
+
@@ -199,11 +250,13 @@

Developers

-

Site built with pkgdown.

+

Site built with pkgdown.

+ + diff --git a/docs/news/index.html b/docs/news/index.html index 319a62b..fac681e 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -6,7 +6,7 @@ -All news • wosr +Changelog • wosr @@ -18,13 +18,24 @@ + + + + + - + + + + + + + @@ -47,8 +58,12 @@ - wosr + + wosr + 0.3.0 + + @@ -81,29 +97,55 @@ -
- -
+
+
-
-
-

-wosr 0.2.0

+
+

+wosr 0.3.0 Unreleased +

New functions

  • -query_wos_apply() and pull_wos_apply() added to issue multiple queries to the WoS API and pull the data for those queries, respectively
  • +pull_cited_refs() added to pull a publication’s cited references (#5) +
  • +pull_related_recs() added to pull a publication’s set of related references
  • +
  • +create_ut_quereis() added to create a list of UT-based queries

Misc

    +
  • An error is no longer thrown when user attempts IP-based authentication (#6)
  • +
  • +write_wos_data() now creates the directory to write files to if it doesn’t already exist
  • +
+
+
+
+

+wosr 0.2.0 2018-09-27 +

+
+

+New functions

+ +
+
+

+Misc

+
  • pull_wos() now returns empty data frames instead of NA if the user’s query returns no results
  • @@ -112,11 +154,12 @@

-

-wosr 0.1.2

-
+

+wosr 0.1.2 2018-07-27 +

+

-New functions

+New functions
-

-wosr 0.1.1

-
+

+wosr 0.1.1 2018-05-03 +

+

-Misc

+Misc
  • The InCites API was updated by Clarivate, including moving to a new endpoint URL and changing the order of fields returned by the “DocumentLevelMetricsByUT” method. Small changes to the internals of pull_incites() were made to reflect this.
-

-wosr 0.1.0

-
+

+wosr 0.1.0 2018-02-06 +

+

-New functions

+New functions
  • auth() added to get a session ID from WoS API server
  • @@ -158,13 +203,13 @@

-
+ + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css index 209ce57..6ca2f37 100644 --- a/docs/pkgdown.css +++ b/docs/pkgdown.css @@ -1,13 +1,32 @@ -/* Sticker footer */ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + body > .container { display: flex; - padding-top: 60px; - min-height: calc(100vh); + height: 100%; flex-direction: column; + + padding-top: 60px; } body > .container .row { - flex: 1; + flex: 1 0 auto; } footer { @@ -16,6 +35,7 @@ footer { border-top: 1px solid #e5e5e5; color: #666; display: flex; + flex-shrink: 0; } footer p { margin-bottom: 0; @@ -38,6 +58,12 @@ img { max-width: 100%; } +/* Typographic tweaking ---------------------------------*/ + +.contents h1.page-header { + margin-top: calc(-60px + 1em); +} + /* Section anchors ---------------------------------*/ a.anchor { @@ -68,7 +94,7 @@ a.anchor { .contents h1, .contents h2, .contents h3, .contents h4 { padding-top: 60px; - margin-top: -60px; + margin-top: -40px; } /* Static header placement on mobile devices */ @@ -100,10 +126,14 @@ a.anchor { margin-bottom: 0.5em; } +.orcid { + height: 16px; + vertical-align: middle; +} + /* Reference index & topics ----------------------------------------------- */ .ref-index th {font-weight: normal;} -.ref-index h2 {font-size: 20px;} .ref-index td {vertical-align: top;} .ref-index .alias {width: 40%;} @@ -137,6 +167,12 @@ pre, code { color: #333; } +pre code { + overflow: auto; + word-wrap: normal; + white-space: pre; +} + pre .img { margin: 5px 0; } @@ -151,6 +187,10 @@ code a, pre a { color: #375f84; } +a.sourceLine:hover { + text-decoration: none; +} + .fl {color: #1514b5;} .fu {color: #000000;} /* function */ .ch,.st {color: #036a07;} /* string */ @@ -161,3 +201,32 @@ code a, pre a { .error { color: orange; font-weight: bolder;} .warning { color: #6A0366; font-weight: bolder;} +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js index 4b81713..de9bd72 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -1,45 +1,110 @@ -$(function() { - $("#sidebar").stick_in_parent({offset_top: 40}); - $('body').scrollspy({ - target: '#sidebar', - offset: 60 - }); +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $("#sidebar") + .stick_in_parent({offset_top: 40}) + .on('sticky_kit:bottom', function(e) { + $(this).parent().css('position', 'static'); + }) + .on('sticky_kit:unbottom', function(e) { + $(this).parent().css('position', 'relative'); + }); + + $('body').scrollspy({ + target: '#sidebar', + offset: 60 + }); - var cur_path = paths(location.pathname); - $("#navbar ul li a").each(function(index, value) { - if (value.text == "Home") - return; - if (value.getAttribute("href") === "#") - return; - - var path = paths(value.pathname); - if (is_prefix(cur_path, path)) { - // Add class to parent
  • , and enclosing
  • if in dropdown - var menu_anchor = $(value); + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + var path = paths(links[i].pathname); + + var length = prefix_length(cur_path, path); + if (length > max_length) { + max_length = length; + pos = i; + } + } + + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); menu_anchor.parent().addClass("active"); menu_anchor.closest("li.dropdown").addClass("active"); } }); -}); -function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(0); + + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 1 : 0); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); -} + return(haystack.length); + } -function is_prefix(needle, haystack) { - if (needle.length > haystack.lengh) - return(false); + /* Clipboard --------------------------*/ - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(false); + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); } - return(true); -} + if(Clipboard.isSupported()) { + $(document).ready(function() { + var copyButton = ""; + + $(".examples, div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); + + // Initialize clipboard: + var clipboardBtnCopies = new Clipboard('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent; + } + }); + + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); + }); + } +})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml new file mode 100644 index 0000000..9782a62 --- /dev/null +++ b/docs/pkgdown.yml @@ -0,0 +1,7 @@ +pandoc: 1.19.2.1 +pkgdown: 1.1.0 +pkgdown_sha: ~ +articles: + faqs: faqs.html + getting-started: getting-started.html + diff --git a/docs/reference/auth.html b/docs/reference/auth.html index 0fbf7d9..886af8d 100644 --- a/docs/reference/auth.html +++ b/docs/reference/auth.html @@ -6,7 +6,7 @@ -Authenticate user credentials auth • wosr +Authenticate user credentials — auth • wosr @@ -18,13 +18,30 @@ + + + + + - + + + + + + + + + + @@ -47,8 +64,12 @@ - wosr + + wosr + 0.3.0 +
  • +
    @@ -81,23 +103,27 @@ -
    +
    +

    auth asks the API's server for a session ID (SID), which you can then pass along to either query_wos or pull_wos. Note, there are limits on how many session IDs you can get in a given period of time (roughly 5 SIDs in a 5 minute period).

    +
    auth(username = Sys.getenv("WOS_USERNAME"),
       password = Sys.getenv("WOS_PASSWORD"))
    -

    Arguments

    +

    Arguments

    @@ -147,11 +173,14 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/docs/reference/create_ut_queries.html b/docs/reference/create_ut_queries.html index f462b37..dec6fe0 100644 --- a/docs/reference/create_ut_queries.html +++ b/docs/reference/create_ut_queries.html @@ -6,7 +6,7 @@ -Create a vector of UT-based queries create_ut_queries • wosr +Create a vector of UT-based queries — create_ut_queries • wosr @@ -18,13 +18,29 @@ + + + + + - + + + + + + + + + + @@ -47,8 +63,12 @@ - wosr + + wosr + 0.3.0 + + @@ -81,21 +102,25 @@ -
    +
    +

    Use this function when you have a bunch of UTs whose data you want to pull and you need to write a series of UT-based queries to do so (i.e., queries in the form "UT = (WOS:000186387100005 OR WOS:000179260700001)").

    +
    create_ut_queries(uts, uts_per_query = 200)
    -

    Arguments

    +

    Arguments

    @@ -142,11 +167,14 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 9768bee..a24f540 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -18,13 +18,24 @@ + + + + + - + + + + + + + @@ -47,8 +58,12 @@ - wosr + + wosr + 0.3.0 + + @@ -81,108 +97,104 @@ -
    -
    +
    +
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    WoS API

    -

    -
    -

    auth

    -

    Authenticate user credentials

    -

    query_wos

    -

    Query the Web of Science

    -

    query_wos_apply

    -

    Run query_wos across multiple queries

    -

    create_ut_queries

    -

    Create a vector of UT-based queries

    -

    pull_wos

    -

    Pull data from the Web of Science

    -

    pull_wos_apply

    -

    Run pull_wos across multiple queries

    -

    read_wos_data

    -

    Read WoS data

    -

    write_wos_data

    -

    Write WoS data

    -

    pull_cited_refs

    -

    Pull cited references

    -

    pull_related_recs

    -

    Pull related records

    -

    InCites API

    -

    -
    -

    pull_incites

    -

    Pull data from the InCites API

    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    WoS API

    +

    +
    +

    auth()

    +

    Authenticate user credentials

    +

    query_wos()

    +

    Query the Web of Science

    +

    query_wos_apply()

    +

    Run query_wos across multiple queries

    +

    create_ut_queries()

    +

    Create a vector of UT-based queries

    +

    pull_wos()

    +

    Pull data from the Web of Science

    +

    pull_wos_apply()

    +

    Run pull_wos across multiple queries

    +

    read_wos_data()

    +

    Read WoS data

    +

    write_wos_data()

    +

    Write WoS data

    +

    pull_cited_refs()

    +

    Pull cited references

    +

    pull_related_recs()

    +

    Pull related records

    +

    InCites API

    +

    +
    +

    pull_incites()

    +

    Pull data from the InCites API

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/docs/reference/pull_cited_refs.html b/docs/reference/pull_cited_refs.html index 915571c..67c1b0e 100644 --- a/docs/reference/pull_cited_refs.html +++ b/docs/reference/pull_cited_refs.html @@ -6,7 +6,7 @@ -Pull cited references pull_cited_refs • wosr +Pull cited references — pull_cited_refs • wosr @@ -18,13 +18,27 @@ + + + + + - + + + + + + + + + + @@ -47,8 +61,12 @@ - wosr + + wosr + 0.3.0 +
    +
    @@ -81,20 +100,24 @@ -
    +
    +

    Pull cited references

    +
    pull_cited_refs(uts, sid = auth(Sys.getenv("WOS_USERNAME"),
       Sys.getenv("WOS_PASSWORD")), ...)
    -

    Arguments

    +

    Arguments

    @@ -166,11 +189,14 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/docs/reference/pull_incites.html b/docs/reference/pull_incites.html index 6062f7d..aeda602 100644 --- a/docs/reference/pull_incites.html +++ b/docs/reference/pull_incites.html @@ -6,7 +6,7 @@ -Pull data from the InCites API pull_incites • wosr +Pull data from the InCites API — pull_incites • wosr @@ -18,13 +18,31 @@ + + + + + - + + + + + + + + + + @@ -47,8 +65,12 @@ - wosr + + wosr + 0.3.0 + + @@ -81,12 +104,15 @@ -
    +
    +

    Important note: The throttling limits on the InCites API are not documented anywhere and are difficult to determine from experience. As such, @@ -94,10 +120,11 @@

    Pull data from the InCites API

    uses exponential backoff (with a maximum wait time of 45 minutes) to determine how long to wait before retrying.

    +
    pull_incites(uts, key = Sys.getenv("INCITES_KEY"), as_raw = FALSE, ...)
    -

    Arguments

    +

    Arguments

    @@ -167,11 +194,14 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/docs/reference/pull_related_recs.html b/docs/reference/pull_related_recs.html index 905f503..0ec1fda 100644 --- a/docs/reference/pull_related_recs.html +++ b/docs/reference/pull_related_recs.html @@ -6,7 +6,7 @@ -Pull related records pull_related_recs • wosr +Pull related records — pull_related_recs • wosr @@ -18,13 +18,28 @@ + + + + + - + + + + + + + + + + @@ -47,8 +62,12 @@ - wosr + + wosr + 0.3.0 + + @@ -81,22 +101,27 @@ -
    +
    +

    Pull the records that have at least one citation in common with a publication of interest.

    +
    -
    pull_related_recs(uts, num_recs, editions = c("SCI", "SSCI", "AHCI", "ISTP",
    -  "ISSHP", "BSCI", "BHCI", "IC", "CCR", "ESCI"),
    -  sid = auth(Sys.getenv("WOS_USERNAME"), Sys.getenv("WOS_PASSWORD")), ...)
    +
    pull_related_recs(uts, num_recs, editions = c("SCI", "SSCI", "AHCI",
    +  "ISTP", "ISSHP", "BSCI", "BHCI", "IC", "CCR", "ESCI"),
    +  sid = auth(Sys.getenv("WOS_USERNAME"), Sys.getenv("WOS_PASSWORD")),
    +  ...)
    -

    Arguments

    +

    Arguments

    @@ -168,11 +193,14 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/docs/reference/pull_wos.html b/docs/reference/pull_wos.html index 636fbab..5849872 100644 --- a/docs/reference/pull_wos.html +++ b/docs/reference/pull_wos.html @@ -6,7 +6,7 @@ -Pull data from the Web of Science pull_wos • wosr +Pull data from the Web of Science — pull_wos • wosr @@ -18,13 +18,28 @@ + + + + + - + + + + + + + + + + @@ -47,8 +62,12 @@ - wosr + + wosr + 0.3.0 + + @@ -81,22 +101,27 @@ -
    +
    +

    pull_wos wraps the process of querying, downloading, parsing, and processing Web of Science data.

    +
    -
    pull_wos(query, editions = c("SCI", "SSCI", "AHCI", "ISTP", "ISSHP", "BSCI",
    -  "BHCI", "IC", "CCR", "ESCI"), sid = auth(Sys.getenv("WOS_USERNAME"),
    -  Sys.getenv("WOS_PASSWORD")), ...)
    +
    pull_wos(query, editions = c("SCI", "SSCI", "AHCI", "ISTP", "ISSHP",
    +  "BSCI", "BHCI", "IC", "CCR", "ESCI"),
    +  sid = auth(Sys.getenv("WOS_USERNAME"), Sys.getenv("WOS_PASSWORD")),
    +  ...)
    -

    Arguments

    +

    Arguments

    @@ -207,11 +232,14 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/docs/reference/pull_wos_apply.html b/docs/reference/pull_wos_apply.html index dc97e5b..58327e2 100644 --- a/docs/reference/pull_wos_apply.html +++ b/docs/reference/pull_wos_apply.html @@ -6,7 +6,7 @@ -Run <code>pull_wos</code> across multiple queries pull_wos_apply • wosr +Run <code>pull_wos</code> across multiple queries — pull_wos_apply • wosr @@ -18,13 +18,27 @@ + + + + + - + + + + + + + + + + @@ -47,8 +61,12 @@ - wosr + + wosr + 0.3.0 + + @@ -81,21 +100,26 @@ -
    +
    +

    Run pull_wos across multiple queries

    +
    -
    pull_wos_apply(queries, editions = c("SCI", "SSCI", "AHCI", "ISTP", "ISSHP",
    -  "BSCI", "BHCI", "IC", "CCR", "ESCI"), sid = auth(Sys.getenv("WOS_USERNAME"),
    -  Sys.getenv("WOS_PASSWORD")), ...)
    +
    pull_wos_apply(queries, editions = c("SCI", "SSCI", "AHCI", "ISTP",
    +  "ISSHP", "BSCI", "BHCI", "IC", "CCR", "ESCI"),
    +  sid = auth(Sys.getenv("WOS_USERNAME"), Sys.getenv("WOS_PASSWORD")),
    +  ...)
    -

    Arguments

    +

    Arguments

    @@ -155,11 +179,14 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/docs/reference/query_wos.html b/docs/reference/query_wos.html index 8c424d7..14a9a48 100644 --- a/docs/reference/query_wos.html +++ b/docs/reference/query_wos.html @@ -6,7 +6,7 @@ -Query the Web of Science query_wos • wosr +Query the Web of Science — query_wos • wosr @@ -18,13 +18,29 @@ + + + + + - + + + + + + + + + + @@ -47,8 +63,12 @@ - wosr + + wosr + 0.3.0 + + @@ -81,23 +102,28 @@ -
    +
    +

    Returns the number of records that match a given query. It's best to call this function before calling pull_wos so that you know how many records you're trying to download before attempting to do so.

    +
    -
    query_wos(query, editions = c("SCI", "SSCI", "AHCI", "ISTP", "ISSHP", "BSCI",
    -  "BHCI", "IC", "CCR", "ESCI"), sid = auth(Sys.getenv("WOS_USERNAME"),
    -  Sys.getenv("WOS_PASSWORD")), ...)
    +
    query_wos(query, editions = c("SCI", "SSCI", "AHCI", "ISTP", "ISSHP",
    +  "BSCI", "BHCI", "IC", "CCR", "ESCI"),
    +  sid = auth(Sys.getenv("WOS_USERNAME"), Sys.getenv("WOS_PASSWORD")),
    +  ...)
    -

    Arguments

    +

    Arguments

    @@ -164,11 +190,14 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/docs/reference/query_wos_apply.html b/docs/reference/query_wos_apply.html index 3c3c588..08a0538 100644 --- a/docs/reference/query_wos_apply.html +++ b/docs/reference/query_wos_apply.html @@ -6,7 +6,7 @@ -Run <code>query_wos</code> across multiple queries query_wos_apply • wosr +Run <code>query_wos</code> across multiple queries — query_wos_apply • wosr @@ -18,13 +18,27 @@ + + + + + - + + + + + + + + + + @@ -47,8 +61,12 @@ - wosr + + wosr + 0.3.0 + + @@ -81,21 +100,26 @@ -
    +
    +

    Run query_wos across multiple queries

    +
    -
    query_wos_apply(queries, editions = c("SCI", "SSCI", "AHCI", "ISTP", "ISSHP",
    -  "BSCI", "BHCI", "IC", "CCR", "ESCI"), sid = auth(Sys.getenv("WOS_USERNAME"),
    -  Sys.getenv("WOS_PASSWORD")), ...)
    +
    query_wos_apply(queries, editions = c("SCI", "SSCI", "AHCI", "ISTP",
    +  "ISSHP", "BSCI", "BHCI", "IC", "CCR", "ESCI"),
    +  sid = auth(Sys.getenv("WOS_USERNAME"), Sys.getenv("WOS_PASSWORD")),
    +  ...)
    -

    Arguments

    +

    Arguments

    @@ -151,11 +175,14 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/docs/reference/read_wos_data.html b/docs/reference/read_wos_data.html index 77d7407..b72b1d3 100644 --- a/docs/reference/read_wos_data.html +++ b/docs/reference/read_wos_data.html @@ -6,7 +6,7 @@ -Read WoS data read_wos_data • wosr +Read WoS data — read_wos_data • wosr @@ -18,13 +18,29 @@ + + + + + - + + + + + + + + + + @@ -47,8 +63,12 @@ - wosr + + wosr + 0.3.0 + + @@ -81,21 +102,25 @@ -
    +
    +

    Reads in a series of CSV files (which were written via write_wos_data) and places the data in an object of class wos_data.

    +
    read_wos_data(dir)
    -

    Arguments

    +

    Arguments

    @@ -139,11 +164,14 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/docs/reference/wosr.html b/docs/reference/wosr.html index 6d3ef70..435cae3 100644 --- a/docs/reference/wosr.html +++ b/docs/reference/wosr.html @@ -6,7 +6,7 @@ -wosr wosr • wosr +wosr — wosr • wosr @@ -18,13 +18,27 @@ + + + + + - + + + + + + + + + + @@ -47,8 +61,12 @@ - wosr + + wosr + 0.3.0 + + @@ -81,15 +100,19 @@ -
    +
    +

    wosr

    +
    @@ -108,11 +131,14 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/docs/reference/write_wos_data.html b/docs/reference/write_wos_data.html index e88cba2..3e0940a 100644 --- a/docs/reference/write_wos_data.html +++ b/docs/reference/write_wos_data.html @@ -6,7 +6,7 @@ -Write WoS data write_wos_data • wosr +Write WoS data — write_wos_data • wosr @@ -18,13 +18,28 @@ + + + + + - + + + + + + + + + + @@ -47,8 +62,12 @@ - wosr + + wosr + 0.3.0 +
    + @@ -81,20 +101,24 @@ -
    +
    +

    Writes each of the data frames in an object of class wos_data to its own csv file.

    +
    write_wos_data(wos_data, dir)
    -

    Arguments

    +

    Arguments

    @@ -146,11 +170,14 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    + + + diff --git a/man/pull_related_recs.Rd b/man/pull_related_recs.Rd index 54d87c2..cdc74cd 100644 --- a/man/pull_related_recs.Rd +++ b/man/pull_related_recs.Rd @@ -4,9 +4,10 @@ \alias{pull_related_recs} \title{Pull related records} \usage{ -pull_related_recs(uts, num_recs, editions = c("SCI", "SSCI", "AHCI", "ISTP", - "ISSHP", "BSCI", "BHCI", "IC", "CCR", "ESCI"), - sid = auth(Sys.getenv("WOS_USERNAME"), Sys.getenv("WOS_PASSWORD")), ...) +pull_related_recs(uts, num_recs, editions = c("SCI", "SSCI", "AHCI", + "ISTP", "ISSHP", "BSCI", "BHCI", "IC", "CCR", "ESCI"), + sid = auth(Sys.getenv("WOS_USERNAME"), Sys.getenv("WOS_PASSWORD")), + ...) } \arguments{ \item{uts}{The documents whose related records you want to pull.} diff --git a/man/pull_wos.Rd b/man/pull_wos.Rd index 6f88f7e..ba355cd 100644 --- a/man/pull_wos.Rd +++ b/man/pull_wos.Rd @@ -4,9 +4,10 @@ \alias{pull_wos} \title{Pull data from the Web of Science} \usage{ -pull_wos(query, editions = c("SCI", "SSCI", "AHCI", "ISTP", "ISSHP", "BSCI", - "BHCI", "IC", "CCR", "ESCI"), sid = auth(Sys.getenv("WOS_USERNAME"), - Sys.getenv("WOS_PASSWORD")), ...) +pull_wos(query, editions = c("SCI", "SSCI", "AHCI", "ISTP", "ISSHP", + "BSCI", "BHCI", "IC", "CCR", "ESCI"), + sid = auth(Sys.getenv("WOS_USERNAME"), Sys.getenv("WOS_PASSWORD")), + ...) } \arguments{ \item{query}{Query string. See the \href{https://images.webofknowledge.com/images/help/WOK/hs_search_operators.html#dsy863-TRS_search_operator_precedence}{WoS query documentation} page diff --git a/man/pull_wos_apply.Rd b/man/pull_wos_apply.Rd index d8f9bc0..f70d259 100644 --- a/man/pull_wos_apply.Rd +++ b/man/pull_wos_apply.Rd @@ -4,9 +4,10 @@ \alias{pull_wos_apply} \title{Run \code{pull_wos} across multiple queries} \usage{ -pull_wos_apply(queries, editions = c("SCI", "SSCI", "AHCI", "ISTP", "ISSHP", - "BSCI", "BHCI", "IC", "CCR", "ESCI"), sid = auth(Sys.getenv("WOS_USERNAME"), - Sys.getenv("WOS_PASSWORD")), ...) +pull_wos_apply(queries, editions = c("SCI", "SSCI", "AHCI", "ISTP", + "ISSHP", "BSCI", "BHCI", "IC", "CCR", "ESCI"), + sid = auth(Sys.getenv("WOS_USERNAME"), Sys.getenv("WOS_PASSWORD")), + ...) } \arguments{ \item{queries}{Vector of queries to issue to the WoS API and pull data for.} diff --git a/man/query_wos.Rd b/man/query_wos.Rd index d9583db..2202aa3 100644 --- a/man/query_wos.Rd +++ b/man/query_wos.Rd @@ -4,9 +4,10 @@ \alias{query_wos} \title{Query the Web of Science} \usage{ -query_wos(query, editions = c("SCI", "SSCI", "AHCI", "ISTP", "ISSHP", "BSCI", - "BHCI", "IC", "CCR", "ESCI"), sid = auth(Sys.getenv("WOS_USERNAME"), - Sys.getenv("WOS_PASSWORD")), ...) +query_wos(query, editions = c("SCI", "SSCI", "AHCI", "ISTP", "ISSHP", + "BSCI", "BHCI", "IC", "CCR", "ESCI"), + sid = auth(Sys.getenv("WOS_USERNAME"), Sys.getenv("WOS_PASSWORD")), + ...) } \arguments{ \item{query}{Query string. See the \href{https://images.webofknowledge.com/images/help/WOK/hs_search_operators.html#dsy863-TRS_search_operator_precedence}{WoS query documentation} page diff --git a/man/query_wos_apply.Rd b/man/query_wos_apply.Rd index 779ccd0..717fe7f 100644 --- a/man/query_wos_apply.Rd +++ b/man/query_wos_apply.Rd @@ -4,9 +4,10 @@ \alias{query_wos_apply} \title{Run \code{query_wos} across multiple queries} \usage{ -query_wos_apply(queries, editions = c("SCI", "SSCI", "AHCI", "ISTP", "ISSHP", - "BSCI", "BHCI", "IC", "CCR", "ESCI"), sid = auth(Sys.getenv("WOS_USERNAME"), - Sys.getenv("WOS_PASSWORD")), ...) +query_wos_apply(queries, editions = c("SCI", "SSCI", "AHCI", "ISTP", + "ISSHP", "BSCI", "BHCI", "IC", "CCR", "ESCI"), + sid = auth(Sys.getenv("WOS_USERNAME"), Sys.getenv("WOS_PASSWORD")), + ...) } \arguments{ \item{queries}{Vector of queries run.}