knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(bibliographeR)
library(dplyr)
library(tidyr)
library(plotly)
library(ggplot2)

Get ids of articles from a query

get_ids()

xml <- get_ids(query = "oyster herpesvirus") %>%
  get_xml() 

Get some informations from the results of the query

make_df()

Example with authors, but you can choose "title", "authors", "year", "journal", "volume", "issue", "pages", "key_words", "doi", "pmid", "abstract"

authors <- xml %>%
  make_df("authors")

authors %>%
  count(authors, sort = TRUE)


authors <- authors %>%
  separate(authors, c("lastname", "firstname"), ", ")

authors %>%
  count(lastname, sort = TRUE)

plot evolution number of article by year

plot_evo <- xml %>%
  make_df("year") %>%
  count(year, sort = TRUE) %>%
  arrange(year) %>%
  mutate(nb_paper = cumsum(n),
         year = as.numeric(year)) %>%
  ggplot(aes(x = year, y = nb_paper )) +
  geom_line() +
  geom_point(col = "red") 

ggplotly(plot_evo)

Get citations

xml %>% 
  get_citations()


cecilesauder/bibliographeR documentation built on July 27, 2019, 7:34 a.m.