Jamie’s R plotting and graphics: How To?

Click on the topic in blue to link to its tutorial on Github.

  • animation

    • gganimate examples of time series plots including the mountain climber from the Price is Right.

  • dataframe & custom table formatting

    • Table rendering options for customized aesthetics within dataframes and tables knitted from RMarkdown to HTML (most generated using the kableExtra package). Instructions for generating print function and passing to df_print so that dataframes are printed in this custom format by default.

  • scaling color to count on a world map

    • Wow, this was a neat experiment for a meeting presentation, but it was more difficult than I anticipated. This involved plotting the number of participants per country who attended the 2020 Society for the Neurobiology of Language Conference.

  • plots, plots, plots

    • Man I love plotting. I’m ashamed to admit I used to use Excel, but no more! Here are numerous plot types all annotated — corrplots, contour plots, heatmaps, dendrograms, scatterplots, you name it.

  • Lego Homelander

    • My favorite show right now is The Boys — I especially enjoy how psychotic the character Homelander is. I adapted Sharice Clough’s brickr R code to create a Homelander lego schematic, complete with a lego brick inventory. This was lots of fun!

  • pubmed subject heading count by year

    • Let’s say you want to plot the citation count by year for a particular subject term in PubMed to show increasing or decreasing popularity or attention to a specific scientific term. Here’s how to do that exemplified with the term, “Pupillometry” tracking counts since 1947.

  • style sheets (.css)

    • font size, colors, container size) can be a bit tricky, especially when it’s HTML. External cascaded style sheets (css) do a great job. Here’s a the custom css file (download here). Just download this little file and dump it in the same directory your .rmd file will render from.




.