Learn R Programming

pnf (version 0.1.1)

is_prime: Primality Test

Description

Determine whether a vector of positive integers m are prime numbers or not.

Usage

is_prime (m)

Arguments

m
A vector of positive integers.

Examples

Run this code
#of the numbers 1 to 30, determine which are primes
m = 1:30
v = is_prime (m)
data.frame (m, v)

Run the code above in your browser using DataLab