Description Usage Arguments Details Value Author(s) See Also Examples

Search a value in an unordered vector.

1 | ```
is_element(x, key)
``` |

`x` |
A vector or matrix with the data. |

`key` |
A value to check if exists in the vector x. |

Find if the key exists in the vector and return returns TRUE/FALSE if the value is been found. If the vector is unordered it is fast but if the vector is ordered then use binary_search. The functions is written in C++ in order to be as fast as possible.

TRUE/FALSE if the value is been found.

Manos Papadakis

R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.

```
binary_search (buit-in R function)
```

1 2 3 | ```
x <- rnorm(500)
key <- x[50]
b <- is_element(x, key)
``` |

```
Loading required package: Rcpp
Loading required package: RcppZiggurat
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.