Tallies the most common sources or authors across a scopus_records object. It works on records already in memory, so it makes no network request.
Usage
scopus_top(x, by = c("source", "author"), n = 10L)Arguments
- x
A scopus_records tibble.
- by
What to tally:
"source"(the publication titles) or"author". Author strings holding several names are split at the semicolon, with or without a space after it, so each contributor is counted once per record. Only aview = "COMPLETE"retrieval holds several names, sinceSTANDARDrecords carry the first author alone (seescopus_records()). A tally by author of a set retrieved underSTANDARDtherefore counts first authorships, and says so with a warning of classscopus_warning_first_author_only, once per session.- n
The number of rows to return (the top
n).
Value
A tibble of class scopus_top with columns value and n, sorted by
descending count, with ties broken by value in byte order so the result is
reproducible across platforms and locales. Exactly n rows are returned
(fewer if there are fewer distinct values), so values tied at the cut-off
rank may be dropped. The by choice is stored in the by attribute.
Examples
# The bundled corpus of real articles stands in for a harvest of your own,
# since 'Scopus' records may not be redistributed.
scopus_top(example_records, by = "source")
#> # A tibble: 10 × 2
#> value n
#> * <chr> <int>
#> 1 ACS Applied Materials & Interfaces 8
#> 2 Journal of Power Sources 5
#> 3 Synthetic Metals 5
#> 4 Electrochimica Acta 4
#> 5 Journal of Materials Chemistry A 4
#> 6 Scientific Reports 4
#> 7 Journal of Alloys and Compounds 3
#> 8 Journal of Energy Storage 3
#> 9 Materials Chemistry and Physics 3
#> 10 Nanotechnology 3
# That corpus names one author per article, so the author tally counts
# first authors. A harvest retrieved with view = "COMPLETE" lists every
# author, and the tally splits them.
scopus_top(example_records, by = "author", n = 5)
#> # A tibble: 5 × 2
#> value n
#> * <chr> <int>
#> 1 Hao Yang 3
#> 2 L. Ojeda 3
#> 3 R. Mendoza 3
#> 4 A.I. Mtz-Enríquez 2
#> 5 Bin Wang 2
