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ú).

Installation

if(!require("remotes")) install.packages("remotes")
remotes::install_github("avallecam/cdcper")

Main functionalities

General usefull functions

Prioritization functions for Data Mining

Visualization functions

Data sets availability

Example

This is a basic example which shows you how to solve a common problem:

library(cdcper)
## basic example code
example(cdc_dotwhiskers_plot)
example(cdc_pareto_lista)
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()
example(cdc_yearweek_to_date)
example(cdc_edades_peru)
example(mutate_ewcdf)
example(gg_forecast)
example(cdc_datatable_html)

To-Do

( ) issue: no visible global function definition estas usando muchas nombres de columna no declarados



avallecam/cdcper documentation built on Dec. 19, 2021, 5:46 a.m.