Pink Floyd’s song Time is a track which portrays the band’s feelings of anxiety towards the passage of time. It is something which sneaks up on you and suddenly “ten years have got behind you.” Personally I share these feelings towards time, but not all bad things come from it’s passing. Learning from the past, specifically your past experiences, can help you make informed decisions about the future. Even though we can not control the flow of time, it is something we can harness and learn from and can help us make informed decisions about the future.
Time and Data
In the world of data, plenty of questions are asked concerning time. Have prices gone up throughout the years? Is an item more scarce then it was in the past? How much have gas prices increase in the past decade? How much value has my car lost since I have purchased it? Are groceries more expensive than they were ten years ago? These questions are broad and can apply to almost any aspect of life. All of these questions involve time in some way, and can be mapped and visualized using the data we collect. However in order to effectively portray time’s effect, you need to gain an understanding of what story you are trying to tell and what type of data you are working with.
Visualize This
Visualizing time seems straightforward. Just choose a variable and it’s corresponding measurement of time and map it to whatever bivariate chart you desire. It is easy to make any visualization concerning time, but it is not so easy to make an effective visualization of time. In Nathan Yau’s book Visualize this, he talks about some of his best practices when visualizing time, while also running through some examples of how to navigate different aspects of time.
In his book, Yau makes an especially important point about visualizing time. He says “Pick chart types that highlight your insights instead of forcing readers to make connections.” The less the reader has to infer about your chart, the better your message will get across to them. Yau also spends a decent amount of this chapter going through his thought process for visualizing different aspects of time, so in a similar vein I thought it would be fun to pick a random data set with some column concerning time and run through Yau’s demo using my own code. For the purpose of this demon I will be using the “household_power_consumptin.txt” dataset found on Kaggle. This data set contains information on the voltage and power usage of millions of households across the US.
Trends
One of the most popular forms of exploring time in data is through exploring trends. Yau Talks about visualizing trends like In this dataset specifically, I want to explore the variable “Global_active_power” and see if it has increased or decreased over time. I start by loading in tidyverse and reading in the txt file into a data frame.
house_power_df = read_delim(“household_power_consumption.txt”, delim = NULL)
I then create a year column using the date column
house_power_df = house_power_df %>%
mutate(year = as.numeric(str_sub(Date, -4, -1)))
I continue by using the year column to group the data and then summarize each average of global active power by
glo_act_pwr_df = house_power_df %>%
mutate(Global_active_power = as.numeric(Global_active_power)) %>%
group_by(year) %>%
summarize(global_act_pwr_per_year = mean(Global_active_power, na.rm = TRUE))
From there we are able to pick a geom which will accurately display our story. If we want to showcase trends, Yau recommends a number of different graphs. We’ll pick a line graph (geom_line) in order to highlight changes in the average active power in kilowatts in a given minute. Yau recommends using a line graph for highlighting trends because of it’s non-complicated and easy to read style. It is easy to visualize time moving from left to right, and it is easy to see the dips and drops in which we want to highlight
ggplot(glo_act_pwr_df, aes(x = year, y = global_act_pwr_per_year)) +
geom_line(color = “red”, linewidth = 1) +
labs(x = “Year”, y = “Mean Active Minutes of Active Power (kilowatts)”, title = str_wrap(“Mean Household Minutes of Active Power by Year”))
ggsave(“line_plot_trends.png”,
width = 8, height = 5, units = “in”)
In this code I add color to the line to distinguish between the background, while also increasing the line to produce this graph:
From this graph you can clearly see that the biggest dip in average household active power per minute was from 2006 to 2007. There are a number of reasons we could assign to this drop; the 2008 financial crisis or a switch in household to more energy efficient technology like LED light bulbs, but it is ultimately not our place to tell. All we can do is observe the trends and look at what the data tells us. For there on out it seems to dip more in 2008, and has been in a slight increase since up until 2010. In using time effectively by picking the appropriate visualization
Sources
-
Pink Floyd – Time Lyrics | Genius Lyrics, genius.com/Pink-floyd-time-lyrics. Accessed 3 Sept. 2026.
-
Baskaran, Aravindkumar. “Household Power Consumption – Text File.” Kaggle, 30 Apr. 2023, www.kaggle.com/datasets/baravindkumar/household-power-consumption-text-file.
-
Nathan, Yau, Visualize This, 2nd Edition [Book], www.oreilly.com/library/view/visualize-this-2nd/9781394214860/. Accessed 4 Sept. 2026.