cdc_edades_peru: Clean age categories

Description Usage Arguments Value Functions Examples

View source: R/cdc_edades.R

Description

Categorize continuous age into classical levels

Usage

1
2
3
cdc_edades_peru(data, variable_edad)

cdc_edades_clean(data, variable_edad, tipo_edad)

Arguments

data

input dataset

variable_edad

edad como variable continua

tipo_edad

tipo de edad: A, M, D o año, mes, día

Value

tidy categorical variables from one continuous age variable

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(tidyverse)
library(charlatan)
library(skimr)
library(rlang)
data_edad <- tibble(age=charlatan::ch_integer(n = 100,min = 2,max = 100))
data_edad %>% skimr::skim_without_charts()
data_edad %>%
  cdc_edades_peru(variable_edad = age) %>% glimpse()
data_edad %>%
  cdc_edades_peru(variable_edad = age) %>%
  select(age,edad_quinquenal) %>%
  group_by(edad_quinquenal) %>%
  skimr::skim() %>%
  select(edad_quinquenal,numeric.p0:numeric.p100)

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