Este endpoint retorna uma lista de registros históricos de estabelecimentos prisionais, com filtros opcionais por cidade e por estabelecimento.
rm(list=ls()) | |
library(tidyverse) | |
library(archive) | |
anos <- list.files('data-raw') | |
arquivos <- NULL | |
for (ano in anos) { | |
arquivos <- bind_rows( | |
arquivos, |
prob_diaria <- function(dias_passados){ | |
dia_quantile <- seq(from = -2, | |
to = 2, | |
length.out = 30) | |
prob <- pnorm(dia_quantile) | |
prob <- c(prob[1], prob[2:29] - prob[1:28], prob[1]) | |
d <- data.frame(dia = (40 * 7 - 15):(40 * 7 + 14), | |
prob) | |
library(RSelenium) | |
library(rvest) | |
library(stringr) | |
library(dplyr) | |
remDr <- remoteDriver(port = 4445L) | |
remDr$open(silent = TRUE) | |
url_prato_aberto <- "https://pratoaberto.sme.prefeitura.sp.gov.br/" | |
remDr$navigate(url_prato_aberto) |