Skip to contents

Download unit-level microdata from microdata.gov.in via mospiR, parse Nesstar binary or fixed-width files via nesstarR, and write raw Parquet files. This is Stage 1 of the two-stage ETL; run ics_harmonize() afterwards to apply concordance tables.

Usage

ics_build(
  round,
  raw_dir = NULL,
  output_dir = file.path("~", "data", "consumption"),
  api_key = NULL,
  compression = "zstd"
)

Arguments

round

Character string identifying the survey round. Must match a key in ics_rounds(). Examples: "68th", "HCES-2022-23".

raw_dir

Path to directory containing downloaded raw data files. If NULL, downloads to a temp directory via mospiR.

output_dir

Path where Parquet files and labels.duckdb will be written. Created if it does not exist.

api_key

MOSPI API key. If NULL, reads from environment variable MOSPI_API_KEY.

compression

Parquet compression codec. Default "zstd".

Value

Invisibly returns output_dir.