Learn R Programming

schoolmath (version 0.4.2)

is.prim: check whether a vector contains prime-numbers

Description

check whether a vector contains prime-numbers

Usage

is.prim(y)

Value

true or false

Arguments

y

the number or vector to check

Examples

Run this code
is.prim(8)  # this will return FALSE
is.prim(11) # this will return TRUE

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