pubs_per_cat: Number of publications per category

View source: R/plot.R

pubs_per_catR Documentation

Number of publications per category

Description

I think it looks better when the bars are horizontal to make the category names easier to read, as the names can be quite long. This will plot a bar chart for the number of publications per category, sorted according to the number of publications.

Usage

pubs_per_cat(
  pubs,
  category,
  fill_by = NULL,
  n_top = NULL,
  isotype = FALSE,
  img_df = NULL,
  img_unit = NULL
)

Arguments

pubs

A data frame at least with a column for the category of interest.

category

Column name to plot. Tidyeval is supported. If it's species or language, then img_df does not have to be supplied for isotype plot since the images are supplied internally.

fill_by

Variable to fill the bars with if not plotting isotypes.

n_top

Number of top entries to plot. Especially useful for isotype.

isotype

Logical, whether to make isotype plot, like one icon stands for a certain number of publications.

img_df

A data frame with one column with the same name as 'category' and another column called 'image_paths' for path to the images. Relative path is fine since it will be internally converted to absolute path. This argument can be left as NULL if category is species or language, since in these two cases, the 'img_df' is provided internally.

img_unit

Integer, how many publications for one icon.

Details

These are the sources of images that are not stated to be under public domain found online with filter "free to share and use". No changes were made to the images unless indicated. The author and license, if found, are listed here as well.

drosophila.jpg

http://gompel.org/images-2/drosophilidae

zebrafish.jpg

https://thumbs.dreamstime.com/m/zebrafish-zebra-barb-danio-rerio-freshwater-aquarium-fish-isolated-white-background-50201849.jpg

ciona.jpg

http://www.habitas.org.uk/marinelife/tunicata/cioints.jpg

xenopus.jpg

https://en.wikipedia.org/wiki/African_clawed_frog#/media/File:Xenopus_laevis_02.jpg by Brian Gratwicke. License: https://creativecommons.org/licenses/by/2.0/

celegans.jpg

https://en.wikipedia.org/wiki/Caenorhabditis_elegans#/media/File:Adult_Caenorhabditis_elegans.jpg by Kbradnam at English Wikipedia. License: https://creativecommons.org/licenses/by-sa/2.5/ A smaller version of the original is used here.

arabidopsis.jpg

http://parts.igem.org/wiki/images/b/bd/Plants_Arabidopsis_thaliana_400px.jpg

skull.jpg

http://pngimg.com/download/42558 License: https://creativecommons.org/licenses/by-nc/4.0/ The original was compressed and converted to jpg here.

platynereis.jpg

https://en.wikipedia.org/wiki/Epitoky#/media/File:PlatynereisDumeriliiFemaleEpitoke.tif By Martin Gühmann. A smaller jpg version of the original is used here. License: https://creativecommons.org/licenses/by-sa/4.0/

yeast.jpg

https://en.wikipedia.org/wiki/Shmoo#/media/File:Shmoos_s_cerevisiae.jpg By Pilarbini. This is a smaller version of the original. License: https://creativecommons.org/licenses/by-sa/4.0/deed.en

Value

A ggplot2 object.


pachterlab/museumst documentation built on April 20, 2024, 11:26 p.m.