2024-09-17

Income Changes by Social Class

This plot showcases the changes in incomes for different social classes over time.

library(plotly)
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
# Sample data for different social classes' incomes over time
time <- seq(1, 10)
lower_class_income <- time * 2000
middle_class_income <- time * 5000
upper_class_income <- time * 10000

data <- data.frame(Time = time, LowerClass = lower_class_income, MiddleClass = middle_class_income, UpperClass = upper_class_income)

# Convert to long format for Plotly
data_long <- reshape2::melt(data, id.vars = "Time")

Interactive Plot

In this plot, you can clearly see the different trends in income changes for lower, middle, and upper social classes.