nik_to_all: Parse gender, birthdate, geolevel (city/regency/province)...

Description Usage Arguments Value Examples

Description

NIK (Nomor Induk Kependudukan) is a unique ID for Indonesia citizens (https://en.wikipedia.org/wiki/Indonesian_identity_card). NIK contains geographic location where the ID card is built, gender and birthdate of the holder.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
nik_to_all(nik, select = c("gender", "bd", "city", "prov"),
  typec = "default", typep = "default")

nik_to_gender(nik, return = "default")

nik_to_bd(nik)

nik_to_city(nik, type = "default")

nik_to_prov(nik, type = "default")

Arguments

nik

NIK (KTP ID)

select

select (gender, bd, city or prov)

typec

return format for city (default, lc or short)

typep

return format for province (default, lc, short or abb)

return

nik_to_gender return type (default, short or abb)

type

return format (default, lc, short or abb)

Value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
nik <- "1671065412990099"
nik_to_bd(nik)
nik_to_city(nik)
nik_to_prov(nik)
nik_to_all(nik)
nik_to_all(nik, select=c("gender","bd"))

# using nik_to_all
df <- data.frame(nik = rep("1671065412990099"), 5)
## Not run: 
df %>%
  mutate(out = map(nik, nik_to_all),
         out = map(out, data.frame)) %>%
  unnest()

# not using nik_to_all
df %>%
  mutate(bd = nik_to_bd(nik),
         city = nik_to_bd(city),
         prov = nik_to_bd(prov))

## End(Not run)

rasyidstat/nusantr documentation built on Nov. 11, 2019, 9:16 p.m.