knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
options(tibble.print_min = 5, tibble.print_max = 5)

nusantr: Indonesia R package

We R Nusantara!

nusantr is an R package which contains:

Installation

You need to use sf package to enable the class of sf data frame.

# install.packages("devtools")
install.packages("sf")
install.packages("tidyverse")
devtools::install_github("rasyidstat/nusantr")

Example

Indonesia Map

You can get Indonesia map by using id_map function that will return sf spatial data frame. It contains two parameters: region and level and currently only contains two regions: "indonesia" and "jakarta".

The data for Indonesia map will be dowloaded from GADM and the data for Jakarta map is get from from Jakarta Smart City.

library(sf)
library(nusantr)
# get jakarta map for 'kelurahan' level
jakarta_kelurahan <- id_map("jakarta", "kelurahan")
jakarta_kelurahan

Datasets

There are various datasets included on this package such as: Transjakarta data, KRL data, Indonesia name data, etc.

# transjakarta halte data
transjakarta

# transjakarta route data
transjakarta_route

NIK

You also can convert NIK (Nomor Induk Kependudukan) or KTP ID to location (city and province), gender and birthdate using nik_to_all, nik_to_gender, nik_to_bd, nik_to_city or nik_to_prov.

nik_to_all("3173060101000010")


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