Description Usage Arguments Details Value See Also Examples
Converts vector to logical based on user specified parameters for the TRUE and false values
1 2 3 4 5 | as.logic(x, true = TRUE, false = FALSE)
as.logicYN(x)
p_yn(x)
|
x |
vector to convert to logical |
true |
Value(s) mapped to |
false |
Value(s) mapped to |
as.logic
coerces x
into a logical vector in which the values
of specified by true
become TRUE
. etc. Values not identified
by true
or false
become NA
logical
vector version of x
.
1 2 3 4 | as.logic( iris$Species, true="setosa", false="virginica" )
yn <- c( "Yes", "NO", "Y", "n" )
as.logicYN(yn)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.