-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
56 lines (44 loc) · 1.36 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
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# autodb
autodb is an R package for automatic normalisation of a data frame to third
normal form, with the intention of easing the process of data cleaning. (Usage
to design your actual database for you is not advised.)
## Installation
You can install the development version of autodb from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("CharnelMouse/autodb")
```
## Example
Turning a simple data frame into a database:
```{r example}
library(autodb)
summary(ChickWeight)
db <- autodb(ChickWeight, name = "ChickWeight")
db
graphviz_text <- gv(db)
DiagrammeR::grViz(graphviz_text)
```
Using the `exclude` argument to forbid certain variables from appearing in keys:
```{r exclude_example}
summary(CO2)
db2_noexclude <- autodb(CO2, name = "CO2")
db2_noexclude
graphviz_text2_noexclude <- gv(db2_noexclude)
DiagrammeR::grViz(graphviz_text2_noexclude)
db2 <- autodb(CO2, name = "CO2", exclude = "uptake")
db2
graphviz_text2 <- gv(db2)
DiagrammeR::grViz(graphviz_text2)
```
There are also functions for doing each step of the database creation separately, including functional dependency detection and normalisation. See the vignette for more details.