Description Usage Arguments Value Author(s) See Also Examples
Array elements that are prime numbers.
1 | isprime(x)
|
x |
numeric vector or matrix containing nonnegative integer values |
Returns an array (or vector) the same size as x
containing logical
1 (true
) for the elements of x
which are prime, and logical
0 (false
) otherwise.
H. Borchers [email protected], P. Roebuck [email protected]
1 2 3 | x <- c(2, 3, 0, 6, 10)
ans <- isprime(x) ## 1, 1, 0, 0, 0
as.logical(ans) ## true, true, false, false, false
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.