library(plotly)
ggplotly(plot)
Interactivity
Due: 2023-11-21 by 11:59pm
Weight: This assignment is worth 1% of your final grade.
Purpose: The purpose of this assignment is to introduce you to the concept of allowing the reader to directly interact with your data. Interactive charts are an entirely different class of data visualizations made possible by advances in computing and other languages like html and javascript.
Assessment: This assignment is graded using a check system:
- ✔+ (110%): Responses shows phenomenal thought and engagement with the course content. I will not assign these often.
- ✔ (100%): Responses are thoughtful, well-written, and show engagement with the course content. This is the expected level of performance.
- ✔− (50%): Responses are hastily composed, too short, and/or only cursorily engages with the course content. This grade signals that you need to improve next time. I will hopefully not assign these often.
Notice that this is essentially a pass/fail system. I’m not grading your writing ability and I’m not counting the number of words you write - I’m looking for thoughtful engagement. One or two sentences is not enough. Write at least a paragraph and show me that you did the readings assigned.
1. Get Organized
Follow these instructions:
- Download and edit this template.
- Unzip the template folder. Make sure you actually unzip it! (in Windows, right-click it and use “extract all”)
- Open the .Rproj file to open RStudio.
- Inside RStudio, open the
hw11.qmd
file, take notes, and write some example code as you go through the readings / exercises below.
2. Readings
This week, I want you to experience some good interactive charts so you can get a sense for how different the user experience is between static and interactive charts.
To get started, find an article online that has some interactive charts. I recommend going to The Pudding - almost all of their articles blend text, data, and interactive charts (e.g. check out the article Are Pop Lyrics Getting More Repetitive?). Choose an article you find interesting, and feel free to use an article on a different site if you wish.
Once you’ve found an article, read through it carefully. As you scroll though it, take note in your reflection this week of some of the key points you remember from the article. Answer these questions:
- What was one main conclusion or point the author made?
- Were any of the visualizations particularly effective in grabbing your attention and supporting that point?
- Was there anything you could critique about the article or charts you saw?
3. Turn any ggplot into an interactive chart with ggplotly()
Now that you’ve seen some interactive charts, make a simple, static chart in the chunk provided in your reflection. It can be any ggplot chart - feel free to copy-paste something we’ve made in class (don’t forget to also copy-paste any data files you may need to create the chart).
Once you’ve made your static chart, make it interactive using the ggplotly()
function from the plotly
package. Simply write code to create your plot
, then use ggplotly(plot)
to make it interactive. Try it out!
4. Reflect
Reflect on what you’ve learned while going through these readings and exercises. Is there anything that jumped out at you? Anything you found particularly interesting or confusing?
Write at least a paragraph in your hw11.qmd
file, and include at least one question. The teaching team will review the questions we get and will try to answer them either in Slack or in class.
Some thoughts you may want to try in your reflection:
- Write about an interesting data visualization about trends you’ve seen.
- “I used to think ______, now I think ______ 🤔”
- Discuss some of the key insights or things you found interesting in the readings or recent class periods.
- Connect the course content to your own work or project you’re working on.
5. Submit
To submit your assignment, follow these instructions:
- Render your .qmd file by either clicking the “Render” button in RStudio or running the command
quarto::quarto_render("hw11.qmd")
command. - Open the rendered html file and make sure it looks good! Is all the formatting as you expected?
- Create a zip file of all the files in your R project folder for this assignment and submit it on the corresponding assignment submission on Blackboard.