checkIfValidDummyVariable | R Documentation |
This helper function checks whether a vector variable comprises only zeros and 1's.
checkIfValidDummyVariable(vector)
vector |
Vector variable |
The logical value: TRUE - if a vector variable passed as the function's parameter represents a valid dummy variable, i.e., comprises only zeros and 1's. FALSE - if a vector variable passed as the function's parameter does not represent a valid dummy variable.
Barbara Kitchenham and Lech Madeyski
print(reproducer:::checkIfValidDummyVariable(c(0, 1, 0, 0)))
# [1] TRUE
print(reproducer:::checkIfValidDummyVariable(c(0, 1, 2, 0)))
# [1] FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.