Author: Oliver Keyes License: MIT Status: In development
primes is a simple package that does two things; tests for prime numbers, and generates prime numbers. Testing can be done with
is_prime, which accepts an integer vector of any length and returns a logical vector of equal length containing, for each element, whether it is prime (TRUE) or not (FALSE).
generate_primes generates every prime number between
min is 0 by default.
Both functions rely on a C++ implementation of Wilson's theorem for testing primality; in theory this is a very slow test, but in practice, due to the restrictions R places around maximum integer sizes, it's fast enough for our needs.
For the development version:
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.