library(ggplot2)
library(dplyr)
# Load required packages
library(ggplot2)
library(dplyr)
# Convert event_date column to POSIXct format
acled_datasx.2 <- as.POSIXct(acled_data$X.2, format = %Y-%m-%d”)
# Aggregate data to daily level (optional)
acled_daily <- acled_data %>%
group_by(x.2) %>%
summarise(total_events = nO)
Finally and most importantly I was asked to plot the timeline
ggplot(acled_daily, aes(x = X.2, y = total_events)) +
geom_line0 +
labs(title = "ACLED Timeline",
x = "Date",
y = "Total Events")
Than I was asked to check structure of the aggregated data frame
str(acled_daily)
str(acled_daily$x.2)
summary
library(ggplotz)
When I submit the console just spits it back at me without anything being graphed … pls pls help
New contributor
Vexan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.