For the 2022-03-15 #tidytuesday, we're working with data compiled by Robert Flight. The data reflects vignette uploads to the CRAN and Bioconductor. I wanted to focus on the seasonal nature of uploads, so I used a spiral plot. This was a great opportunity to use the spiralize and ComplexHeatmap packages by Zuguang Gu. I had to rely a lot on the grid functionality to add the title, subtitles, and caption. I found these posts by particularly helpful. Note: I used the zoo package to calculate the 7-day rolling averages. All code is available at github
-
-
2 TidyTuesdays
The last two weeks of #tidytuesday have both involved data that can be spatially mapped. They were a good opportunity to get more familiar with showing information on states in the US or countries in Europe. Alternative fuel sources in the US The data for 2022-03-01 are fueling stations throughout the US that offer alternatives to gasoline or diesel. I used the usmap package to help plot this one: Code for this graphic is here Erasmus exchange program The data for 2022-03-08 come from the Erasmus+ exchange program. It allows students to travel to other countries. I decided to look at which countries received more students than they sent away.…
-
Decoding Fairness
Part of a my dissertation looked at how people balance self-interest with fairness for others. It may seem obvious that people pay attention to their own interests first, but there is some good evidence that people are actually intuitive cooperators and default to considering how their choices affect other people. I tested these two views using a modified verison of the Ultimatum Game while I recorded electroencephalography (EEG). On each trial participants saw $12 split between three people and were asked to accept or reject the offer. I used this setup to independently manipulate fairness for the self or another person, then trained two families of support vector machines to…
-
My first #TidyTuesday
I've enjoyed lurking the #tidytuesday hastag on Twitter. For those unfamiliar - every Tuesday a new dataset is provided, and folks are encouraged to practice their data visualization skills, especially within the tidyverse. For Black History Month, the goal is to recreate some of the iconic images that W.E.B. Du Bois created for the 1900 Paris Exposition. For this week, the goal is to recreate “Valuation of Town and City Property Owned by Georgia Negroes” (plate 21) Overall, I'm pretty happy with how this turned out. Here's a sneak peak at the final product. You can find all of the code for these plots
-
Visualize an interaction with ggplot
I've had to do this enough times (and have to look it up each time) that I decided to memorialize it here. The issue: I have a two-way repeated measures design and I want to visualize all four cells. I'd like one plot to contain the individuals responses as well as the cell means. But I also want to link individuals together. The solution: Plot the individual differences within each level of one of the factors using separate lines for each subject, plus an additional line for the cell means. Here's a simple demo (with a bonus example of how to simulate such a dataset).