knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

iNZightTools

R-CMD-check Coverage status License: GPL v3 CRAN

Package consisting of a set of helper functions for doing data science with iNZight. These functions are designed to work well with a graphical user interface (GUI), but many^[with others being modified in time] are functional for direct use through R.

Installation

The current release version is available on CRAN:

install.packages("iNZightTools")

The development version can be downloaded from GitHub:

remotes::install_github("iNZightVIT/iNZightTools@dev")

Basic usage

The package itself doesn't have any one specific use, but the functions can be broken down into various workflows.

library(iNZightTools)

Most of the functions return not only the resulting data, but attach the tidyverse code used to generate it. This is useful for GUIs that display code history (e.g., iNZight) or when learning to code.

Data import

Importing data is done using the smart_read() function, which can read CSV, Excel, Stata, SAS, RData, and a few other formats based on the file extension.

data <- smart_read(system.file("extdata/cas500.xls", package = "iNZightTools"))
str(data)
tidy_all_code(code(data))

Surveys

Being an important but tricker data type to work with, iNZightTools includes methods for easily importing surveys using a specification format. For details, check out https://inzight.nz/docs/survey-specification.html

Other

There are many other data manipulation-focussed functions, such as filter, renaming variables, etc.

filter_num(data, "height", "<", 150)


iNZightVIT/iNZightTools documentation built on June 13, 2025, 12:35 p.m.