Skip to content

Instantly share code, notes, and snippets.

@sckott
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sckott/9e021eb1c6a949158d69 to your computer and use it in GitHub Desktop.
Save sckott/9e021eb1c6a949158d69 to your computer and use it in GitHub Desktop.

🐜

The fulltext package is coming along - we recently added functionality to browse to an article. That is, a workflow may consist of

  • searching for articles
  • getting full text of some of those articles, or maybe all of them
  • then, you may want to look at one or more of them, this is where ft_browse() comes in

Installation, loading

install.packages("devtools")
devtools::install_github("ropensci/fulltext")
library("fulltext")

browse

You can browse the article on Macrodocs (the default option), a nice modern day browser for articles

x <- ft_get(ids='10.7554/eLife.04300', from='elife')
ft_browse(x)

macrodocs

Or you can go directly to the publishers version

ft_browse(x, "publisher")

publisher

OR, you can view a certain section of an article, across many articles

opts <- list(fq=list('doc_type:full',"article_type:\"research article\""))
ft_search(query='ecology', from='plos', limit=2, plosopts = opts)$plos$data$id %>% 
  ft_get(from = "plos") %>% 
  ft_browse_sections("abstract")

img

chunks

That last bit about viewing sections in the browser uses another new function: chunks(). That function allows you to get one or more parts of an article across many articles. Right now it only handles plos and elife articles, and only XML format.

Get some PLOS articles

opts <- list(fq=list('doc_type:full',"article_type:\"research article\""))
x <- ft_search(query='ecology', from='plos', limit=2, plosopts = opts)$plos$data$id %>% 
  ft_get(from = "plos") 

Get abstracts

chunks(x, what="abstract")
#> $plos
#> $plos$`10.1371/journal.pone.0059813`
#> $plos$`10.1371/journal.pone.0059813`$abstract
#> [1] "It is thought that the science of ecology has experienced conceptual shifts in recent decades, chiefly from viewing nature as static and balanced to a conception of constantly changing, unpredictable, complex ecosystems. Here, we ask if these changes are reflected in actual ecological research over the last 30 years. We surveyed 750 articles from the entire pool of ecological literature and 750 articles from eight leading journals. Each article was characterized according to its type, ecological domain, and applicability, and major topics. We found that, in contrast to its common image, ecology is still mostly a study of single species (70% of the studies); while ecosystem and community studies together comprise only a quarter of ecological research. Ecological science is somewhat conservative in its topics of research (about a third of all topics changed significantly through time), as well as in its basic methodologies and approaches. However, the growing proportion of problem-solving studies (from 9% in the 1980s to 20% in the 2000 s) may represent a major transition in ecological science in the long run."
#> 
#> 
#> $plos$`10.1371/journal.pone.0001248`
#> $plos$`10.1371/journal.pone.0001248`$abstract
#> [1] "BackgroundSoil ecology has produced a huge corpus of results on relations between soil organisms, ecosystem processes controlled by these organisms and links between belowground and aboveground processes. However, some soil scientists think that soil ecology is short of modelling and evolutionary approaches and has developed too independently from general ecology. We have tested quantitatively these hypotheses through a bibliographic study (about 23000 articles) comparing soil ecology journals, generalist ecology journals, evolutionary ecology journals and theoretical ecology journals.FindingsWe have shown that soil ecology is not well represented in generalist ecology journals and that soil ecologists poorly use modelling and evolutionary approaches. Moreover, the articles published by a typical soil ecology journal (Soil Biology and Biochemistry) are cited by and cite low percentages of articles published in generalist ecology journals, evolutionary ecology journals and theoretical ecology journals.ConclusionThis confirms our hypotheses and suggests that soil ecology would benefit from an effort towards modelling and evolutionary approaches. This effort should promote the building of a general conceptual framework for soil ecology and bridges between soil ecology and general ecology. We give some historical reasons for the parsimonious use of modelling and evolutionary approaches by soil ecologists. We finally suggest that a publication system that classifies journals according to their Impact Factors and their level of generality is probably inadequate to integrate â\u0080\u009cparticularityâ\u0080\u009d (empirical observations) and â\u0080\u009cgeneralityâ\u0080\u009d (general theories), which is the goal of all natural sciences. Such a system might also be particularly detrimental to the development of a science such as ecology that is intrinsically multidisciplinary."

Get journal metadata

chunks(x, what="journal_meta")
#> $plos
#> $plos$`10.1371/journal.pone.0059813`
#> $plos$`10.1371/journal.pone.0059813`$journal_meta
#> $plos$`10.1371/journal.pone.0059813`$journal_meta$`journal-id`
#> [1] "PLoS ONE"
#> 
#> $plos$`10.1371/journal.pone.0059813`$journal_meta$`journal-id`
#> [1] "plos"
#> 
#> $plos$`10.1371/journal.pone.0059813`$journal_meta$`journal-id`
#> [1] "plosone"
#> 
#> $plos$`10.1371/journal.pone.0059813`$journal_meta$`journal-title-group`
#> $plos$`10.1371/journal.pone.0059813`$journal_meta$`journal-title-group`$`journal-title`
#> [1] "PLoS ONE"
#> 
#> 
#> $plos$`10.1371/journal.pone.0059813`$journal_meta$issn
#> [1] "1932-6203"
#> 
#> $plos$`10.1371/journal.pone.0059813`$journal_meta$publisher
#> $plos$`10.1371/journal.pone.0059813`$journal_meta$publisher$`publisher-name`
#> [1] "Public Library of Science"
#> 
#> $plos$`10.1371/journal.pone.0059813`$journal_meta$publisher$`publisher-loc`
#> [1] "San Francisco, USA"
#> 
#> 
#> 
#> 
#> $plos$`10.1371/journal.pone.0001248`
#> $plos$`10.1371/journal.pone.0001248`$journal_meta
#> $plos$`10.1371/journal.pone.0001248`$journal_meta$`journal-id`
#> [1] "PLoS ONE"
#> 
#> $plos$`10.1371/journal.pone.0001248`$journal_meta$`journal-id`
#> [1] "plos"
#> 
#> $plos$`10.1371/journal.pone.0001248`$journal_meta$`journal-id`
#> [1] "plosone"
#> 
#> $plos$`10.1371/journal.pone.0001248`$journal_meta$comment
#> NULL
#> 
#> $plos$`10.1371/journal.pone.0001248`$journal_meta$`journal-title-group`
#> $plos$`10.1371/journal.pone.0001248`$journal_meta$`journal-title-group`$`journal-title`
#> [1] "PLoS ONE"
#> 
#> 
#> $plos$`10.1371/journal.pone.0001248`$journal_meta$issn
#> [1] "1932-6203"
#> 
#> $plos$`10.1371/journal.pone.0001248`$journal_meta$publisher
#> $plos$`10.1371/journal.pone.0001248`$journal_meta$publisher$`publisher-name`
#> [1] "Public Library of Science"
#> 
#> $plos$`10.1371/journal.pone.0001248`$journal_meta$publisher$`publisher-loc`
#> [1] "San Francisco, USA"
@sckott
Copy link
Author

sckott commented Jan 9, 2015

🐜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment