1
I would like from an archive, which in the case of public safety indicators of Rio de Janeiro, generate charts for each year of the database, showing the progress of these indicators over the months. Unfortunately the initial idea I had, which is below, didn’t work.
# link do site com os arquivos utilizados
# Séries históricas do estado por mês desde 1991 (números absolutos)
http://www.ispdados.rj.gov.br/EstSeguranca.html
# Leitura do arquivo
Ind_mensais <- read.csv(file = "DOMensalEstadoDesde1991.csv", sep = ";",
dec = ",")
# Loop que filtraria por ano as informações e geraria um gráfico
library(ggplot2)
for(i in 1992:2019){
ano<-filter(Ind_mensais,vano == i)
ggplot(ano,mapping = aes(x =mes,y=latrocinio))+geom_line()
}
Thank you very much, it was exactly this detail that was missing and the labels in the months will greatly improve the visualization.
– Alvaro Emanuel