knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
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.
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")
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.
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))
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
There are many other data manipulation-focussed functions, such as filter, renaming variables, etc.
filter_num(data, "height", "<", 150)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.