> For the complete documentation index, see [llms.txt](https://r-pedia.gitbook.io/cevi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://r-pedia.gitbook.io/cevi/data-types/dealing-with-logicals.md).

# -Dealing with Logicals

```r
x <- 5

x > 13
## [1] FALSE
```

```r
x <- c(5, 14, 10, 22)

x > 13
## [1] FALSE  TRUE FALSE  TRUE
```

```r
12 == 12
## [1] TRUE

12 <= c(12, 11)
## [1]  TRUE FALSE

12 %in% c(12, 11, 8)
## [1] TRUE

x <- c(12, NA, 11, NA, 8)
is.na(x)
## [1] FALSE  TRUE FALSE  TRUE FALSE
```

```r
x <- c(5, 14, 10, 22)

# how many elements in x are greater than 13?
sum(x > 13)
## [1] 2
```
