-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
81 lines (68 loc) · 2.29 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# covidTJSP <img src='man/figures/logo.png' align="right" height="138" />
<!-- badges: start -->
[](https://github.com/abjur/covidTJSP/actions)
<!-- badges: end -->
Baixa e estrutura dados de covid do TJSP.
```{r}
library(covidTJSP)
```
**Última atualização:** `r format(Sys.Date(), "%d/%m/%Y")`.
Os dados podem ser baixados nos links abaixo.
- [Consulta de Julgados do Primeiro Grau](https://storage.googleapis.com/covid-tjsp/da_cjpg_covid.csv)
- [Consulta de Processos do Primeiro Grau](https://storage.googleapis.com/covid-tjsp/da_cpopg_covid.csv)
## Exemplo de aplicação
```{r simple-plot, dpi = 300, fig.height=6, fig.width=7}
covidTJSP::da_cjpg_covid %>%
dplyr::arrange(dplyr::desc(date)) %>%
dplyr::distinct(n_processo, .keep_all = TRUE) %>%
dplyr::mutate(
mes = lubridate::floor_date(date, "month"),
ano = as.character(lubridate::year(date))
) %>%
dplyr::count(ano, mes) %>%
dplyr::arrange(ano, mes) %>%
dplyr::mutate(acu = cumsum(n)) %>%
dplyr::mutate(tipo = dplyr::case_when(
mes == lubridate::floor_date(Sys.Date(), "month") ~ "incompleto",
TRUE ~ "completo"
)) %>%
ggplot2::ggplot(ggplot2::aes(mes, n, fill = tipo)) +
ggplot2::geom_col() +
ggplot2::scale_x_date(
date_breaks = "1 month",
date_labels = "%b"
) +
ggplot2::scale_y_continuous(labels = scales::number_format(
big.mark = ".", decimal.mark = ","
)) +
ggplot2::scale_fill_viridis_d(begin = .2, end = .8) +
ggplot2::guides(fill = "none") +
ggplot2::facet_wrap(~ano, scales = "free_x", ncol = 2) +
ggplot2::theme_minimal(12) +
ggplot2::labs(
title = "Quantidade de decisões no 1º grau",
subtitle = "Citando termos relacionados a Covid-19",
x = "Mês",
y = "Quantidade de decisões",
caption = paste(
"Fonte: Consulta de Julgados 1º Grau TJSP",
"Extração de dados: Pacote {lex} - Terranova Consultoria",
"Gráfico: Associação Brasileira de Jurimetria",
sep = "\n"
)
)
```
# Licença
MIT