plot_density: Density and histogram plots from PLOS Article Level Metrics...

View source: R/plot_density.R

plot_densityR Documentation

Density and histogram plots from PLOS Article Level Metrics data

Description

Density and histogram plots from PLOS Article Level Metrics data

Usage

plot_density(input, source = "scopus_total", color = "#1447f2",
  title = "", description = "", plot_type = "density")

Arguments

input

A data.frame, usuaally from a call to link{alm}.

source

Data source (column) to plot. Can be a single element, or a character vector.

color

Color of the density plot and the title. Can be a hex color or rgb, etc.

title

Title for the plot, in top matching the color of the density plot.

description

Optional description, subtending the title.

plot_type

Type of plot, one of density (default) or histogram.

Author(s)

Martin Fenner, mfenner@plos.org, modified by Scott Chamberlain

References

See a tutorial/vignette for alm at http://ropensci.org/tutorials/alm_tutorial.html

Examples

## Not run: 
library('rplos'); library('plyr')
dois <- searchplos(q='*:*', fl="id",
   fq=list(
     'cross_published_journal_key:PLoSONE',
     'doc_type:full',
     'publication_date:[2010-01-01T00:00:00Z TO 2010-12-31T23:59:59Z]',
     '-article_type:correction'),
   limit=50)
dois <- dois$data$id[!grepl("annotation", dois$data$id)]
alm <- alm_ids(doi=dois, total_details=TRUE)
alm <- ldply(alm$data, data.frame)
plot_density(alm)
plot_density(alm, color="#DCA121")
plot_density(alm, title="Scopus citations from 2010")
plot_density(alm, title="Scopus citations from 2010", description="Probablity of
   X number of citations for a paper")
plot_density(alm, description="Probablity of X number of citations for a paper")
plot_density(alm, source="crossref_total")
plot_density(alm, source="twitter_total")
plot_density(alm, source="counter_total")
plot_density(alm, source=c("counter_total","facebook_likes"))
plot_density(alm, source=c("counter_total","facebook_likes"))
plot_density(alm, source=c("counter_total","facebook_likes", "twitter_total"))
plot_density(alm, source=c("counter_total","crossref_total","twitter_total"),
   color=c("#DBAC6A", "#E09B33", "#A06D34"))
plot_density(alm, source=c("counter_total","crossref_total",
   "twitter_total"))
plot_density(alm, source=c("counter_total","crossref_total"),
   title="Counter and Crossref")
plot_density(alm, source=c("counter_total","crossref_total",
   "twitter_total"), color=c("#83DFB4","#EFA5A5","#CFD470"))

## End(Not run)

ropensci/alm documentation built on May 18, 2022, 9:47 a.m.