Learn R Programming

schoolmath (version 0.5.1)

is.prim: Check whether a vector contains prime numbers

Description

Check whether a vector contains prime numbers

Usage

is.prim(x)

Value

A logical vector indicating whether values are prime.

Arguments

x

The number or vector to check.

Examples

Run this code
is.prim(8)
is.prim(11)

x <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
is.prim(x)

Run the code above in your browser using DataLab