R and RStudio first days

Work I have been doing in DataStudio and a recent article on PowerBI, Tableau, and Shiny, caused me to take another look at R and RStudio. As an instructor of statistics I am more than keenly aware that R is the go to tool for statistics and data exploration. This is not my first foray into R, but this time the journey is driven by work to explore producing student learning outcome dashboards. 

The student learning outcomes data is tidy data and that makes use of the Tidyverse package possible. Still, the journey is far more challenging than a spreadsheet or business intelligence dashboard. Even once I have a working line of code, there are pieces of the code line that I simply do not understand. This is something I am accustomed to when tackling software, but some of the more baffling aspects do not seem to be explained and do not resolve themselves in my mind once they are working. I am more used to languages that once the code is working, I can then see why the code is working. R remains opaque to me, even after I have a working line. 

In four days, twelve chapters, and multiple videos, I was able to generate the chart above. All of the effort and the result is but three lines of code.

library(tidyverse)
outcomes <- read_csv("outcomesetl.csv")
outcomes %>%
  group_by(type, cslo) %>%
  summarize(avg_score = mean(outcomescore, na.rm = TRUE)) %>% 
  ggplot() + 
  geom_bar(mapping = aes(x = cslo, y = avg_score, fill = type), stat = "identity", position=position_dodge()) +
  labs(title="Course learning outcome average performance",  x="Course student learning outcomes",  y = "Average") +
  scale_fill_manual(values=c('#999999','#E69F00'))

For me this exploration is not necessarily about eventually producing production dashboards. My gut sense is that were I to do this, there would be no one who could maintain and alter the code in the future. R programmers do not grow on trees, at least not around here. For me playing with R is like someone working a multi-thousand piece jigsaw puzzle without looking at the cover. One has a vague idea of the cover from when one purchased the puzzle, or took the puzzle down off the shelf. I have a vague idea of what the output I am hoping to obtain will look like. But each word in a line is a puzzle piece, fitting that puzzle together is, for me, a pastime. 

Code and software are two of my after hours activities. As with one who works on a puzzle, the joy is in the process of putting the puzzle together, not in having something useful at the end of the process. I enjoy the act of coding, and like those solving a Rubik's cube, there is some pleasure at obtaining a solved puzzle. That moment when you get the picture on the cover of the box - or a chart that you worked on obtaining for four days. And then you go on to the next box of puzzle pieces. Maybe something with even more pieces.



Comments

Popular posts from this blog

Plotting polar coordinates in Desmos and a vector addition demonstrator

Traditional food dishes of Micronesia

Setting up a boxplot chart in Google Sheets with multiple boxplots on a single chart