Learn R Programming

mongolstats (version 0.1.1)

nso_rebuild_px_index: Rebuild PXWeb index and optionally write to a file

Description

Crawls the PXWeb API to rebuild the table index. If path is provided, the index is written to that file; otherwise only the in-memory index is refreshed.

Usage

nso_rebuild_px_index(path = NULL, write = !is.null(path))

Value

A tibble containing the rebuilt table index.

Arguments

path

Output path for JSON. If NULL (default), no file is written. For package development, use "inst/extdata/px_index.json".

write

Whether to write JSON to path. Defaults to TRUE if path is provided, FALSE otherwise.

Examples

Run this code
# Rebuild in-memory index only (takes time to crawl API)
# \donttest{
idx <- nso_rebuild_px_index()
head(idx)
# }

Run the code above in your browser using DataLab