https://github.com/avallecam/cdcper
Miscelanea de funciones customizadas a tareas de análisis en CDC Perú
https://github.com/avallecam/cdcper
data-manipulation data-mining data-visualization data-wrangling r tidyverse
Last synced: 5 months ago
JSON representation
Miscelanea de funciones customizadas a tareas de análisis en CDC Perú
- Host: GitHub
- URL: https://github.com/avallecam/cdcper
- Owner: avallecam
- Created: 2020-08-21T21:01:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-10-11T17:11:07.000Z (over 4 years ago)
- Last Synced: 2025-01-13T08:47:05.662Z (about 1 year ago)
- Topics: data-manipulation, data-mining, data-visualization, data-wrangling, r, tidyverse
- Language: R
- Homepage: https://github.com/avallecam/cdcper
- Size: 335 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
output: github_document
editor_options:
chunk_output_type: console
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
options(tidyverse.quiet = TRUE,warn = -1)
```
# cdcper
El objetivo de `cdcper` es agilizar la creación de variables, gráficos
e importación bases de datos de relevancia para el Centro Nacional de Epidemiología,
Prevención y Control
de Enfermedades [(CDC Perú)](https://www.dge.gob.pe/portalnuevo/).
## Installation
``` r
if(!require("remotes")) install.packages("remotes")
remotes::install_github("avallecam/cdcper")
```
## Main functionalities
### General usefull functions
- `cdc_edades_peru`: crea categorias de edades comunmente usadas.
- `read_reunis_total`: brinda la poblacion del año en curso
con la base de datos de REUNIS.
- `read_reunis_edad`: brinda la población estratificada por sexo y etapas de vida
con la base de datos de REUNIS.
- `read_inei_poblacion`: lee archivos de población del INEI.
### Prioritization functions for Data Mining
- `cdc_pareto_lista`: calcula porcentaje de aporte individual y aporte acumulado de elementos en una lista a priorizar.
- `cdc_carga_coalesce`: permite unir (logical connector OR) los listas priorizadas y generar una lista concenso.
### Visualization functions
- `cdc_dotwhiskers_plot`: genera un grafico punto-bigotes con la estimación puntual del promedio e intervalo de confianza de una variable continua por niveles de una variable categórica.
### Data sets availability
- `denominadores_departamento_2000_2020_peru` department level population estimates 2000-2020
- `edad_estandarizada_who` estandardize factors to estandardize raw rates by age
## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
library(cdcper)
## basic example code
```
```{r}
example(cdc_dotwhiskers_plot)
```
```{r,eval=FALSE}
example(cdc_pareto_lista)
```
```{r}
library(tidyverse)
library(charlatan)
n_obs <- 11
set.seed(n_obs)
ch_data_wide <- tibble(
#names
name = ch_currency(n = n_obs),
#values
category = ch_integer(n = n_obs,min = 0,max = 1) %>% as.logical(),
# category_02 = ch_integer(n = n_obs,min = 0,max = 1) %>% as.logical(),
value_01 = ch_beta(n = n_obs,shape1 = 2,shape2 = 8),
value_02 = ch_integer(n = n_obs,min = 0.7,max = 10)) %>%
pivot_longer(cols = value_01:value_02,
names_to = "variable",
values_to = "numeric") %>%
mutate(beta = ch_beta(n = n_obs*2,shape1 = 1,shape2 = 8))
cdcper::cdc_pareto_lista(data = ch_data_wide,
variable = numeric,
pareto_cut = 80) %>%
avallecam::print_inf()
cdcper::cdc_pareto_lista(data = ch_data_wide,
variable = numeric,
pareto_cut = 80) %>%
cdcper::cdc_pareto_plot(pct_ = pct_numeric,
cum_ = cum_numeric,
variable_value = numeric,
variable_label = name) #%>%
# plotly::ggplotly()
```
```{r}
example(cdc_yearweek_to_date)
```
```{r}
example(cdc_edades_peru)
```
```{r}
example(mutate_ewcdf)
```
```{r}
example(gg_forecast)
```
```{r}
example(cdc_datatable_html)
```
## To-Do
( ) issue: _no visible global function definition_ estas usando muchas nombres de columna no declarados