mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-26 09:21:00 +03:00
Update r.html.markdown
Added logical operators that were missing.
This commit is contained in:
parent
6915f5bfd0
commit
209dc039ec
@ -229,6 +229,13 @@ FALSE != FALSE # FALSE
|
||||
FALSE != TRUE # TRUE
|
||||
# Missing data (NA) is logical, too
|
||||
class(NA) # "logical"
|
||||
# Use for | and & for logic operations.
|
||||
# OR
|
||||
TRUE | FALSE # TRUE
|
||||
# AND
|
||||
TRUE & FALSE # FALSE
|
||||
# You can test if x is TRUE
|
||||
isTRUE(TRUE) # TRUE
|
||||
# Here we get a logical vector with many elements:
|
||||
c('Z', 'o', 'r', 'r', 'o') == "Zorro" # FALSE FALSE FALSE FALSE FALSE
|
||||
c('Z', 'o', 'r', 'r', 'o') == "Z" # TRUE FALSE FALSE FALSE FALSE
|
||||
|
Loading…
Reference in New Issue
Block a user