-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME.Rmd
69 lines (47 loc) · 2.28 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# iNZightTools
![R-CMD-check](https://github.com/iNZightVIT/iNZightTools/workflows/R-CMD-check/badge.svg)
[![Coverage status](https://codecov.io/gh/iNZightVIT/iNZightTools/branch/dev/graph/badge.svg)](https://codecov.io/github/iNZightVIT/iNZightTools?branch=dev)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![CRAN](https://www.r-pkg.org/badges/version/iNZightTools)](https://CRAN.R-project.org/package=iNZightTools)
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:
```{r,eval=F}
install.packages("iNZightTools")
```
The development version can be downloaded from GitHub:
```{r,eval=F}
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.
```{r}
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.
```{r,warning=FALSE}
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.
```{r}
filter_num(data, "height", "<", 150)
```