next_prime | R Documentation |
Find the next prime numbers or previous prime numbers over a vector.
next_prime(x)
prev_prime(x)
x |
a vector of integers from which to start the search. |
For prev_prime
, if a value is less than or equal to 2, the function will
return NA
.
An integer vector of prime numbers.
Paul Egeler, MS
next_prime(5)
## [1] 7
prev_prime(5:7)
## [1] 3 5 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.