knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(dcmodify) library(dcmodifydb)
The goal of dcmodifydb is to apply modification rules specified with dcmodify
on a database table, allowing for documented, reproducable data cleaning adjustments
in a database.
This vignette describes the supported syntax that can be used with dcmodify
and
dcmodifydb
.
For common error scenario's see vignette("scenarios", package="dcmodifydb")
if
rulem <- modifier( if (age < 12) income = 0)
The following statements are equivalent. It is wise to choose a syntax that is familiar to the persons specifying the correction rules.
```{eval=FALSE} if (age < 12) income = 0 # R noobs if (age < 12) income <- 0 # a bit more R-y income[age < 12] <- 0 # very R-y
### `else` Each `if` rule may be followed with an `else` or `else if` ```r m <- modifier(if (age > 67) {retired = TRUE} else {retired = FALSE})
The following statements are equivalent. It is wise to choose a syntax that is familiar to the persons specifying the correction rules.
```{eval=FALSE} if (age > 67) {retired = TRUE} else {retired = FALSE} # R noobs if (age > 67) {retired <- TRUE} else {retired <- FALSE} # R-y retired <- if (age > 67) TRUE else FALSE # very R-y retired <- age > 67 # very R-y
### multiple assignments ```r m <- modifier( if (age > 67) { retired = TRUE salary = 0 } )
else if
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.