Description Usage Arguments Value Details Note See Also
Rules for deterministic correction
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | correctionRules(x, strict = TRUE, allowed = getOption("allowedSymbols"),
...)
## S3 method for class 'character'
correctionRules(x, strict = TRUE,
allowed = getOption("allowedSymbols"), file = TRUE, ...)
## S3 method for class 'expression'
correctionRules(x, strict = TRUE,
allowed = getOption("allowedSymbols"), ...)
## S3 method for class 'correctionRules'
print(x, ...)
## S3 method for class 'correctionRules'
as.character(x, oneliner = FALSE, ...)
## S3 method for class 'correctionRules'
getVars(E, ...)
|
x |
|
strict |
If |
allowed |
A |
... |
Currently unused. |
file |
If |
oneliner |
Coerce to oneliner |
E |
object of class |
correctionRules
returns an object of class correctionRules
getVars
returns a character vector of variable names.
Data editing processes are rarely completely governed by in-record consistency rules.
Many ad-hoc rules are commonly used to impute empty or erroneous values.
Such rules are often applied manually or hidden in source code. This
function, together with correctWithRules
allows for easy definition and execution
of simle deterministic replacement rules.
These functions are ment to support very simple rules, such as if variable x is missing, then
set it to zero. Such actions usually basically model-free corrections stemming from subject-matter knowledge.
Given the nature of such rules, the type of rules are by default limited to R-statements containing
conditionals (if
-else
), arithmetic and logical operators, and brackets and assignment operators.
see getOption('allowedSymbols')
for a complete list.
If you cannot execute your 'simple' corrections with just these functions, we strongly recommend to write a separate imputation or correction routine. However, it's a free world, so you may alter the list of allowed symbols as you wish.
getVars
is overloaded from the editrules
package.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.