powered by
isprime(x)
x
true
false
factors
primes
x <- c(2, 3, 0, 6, 10) ans <- isprime(x) ## 1, 1, 0, 0, 0 as.logical(ans) ## true, true, false, false, false
Run the code above in your browser using DataLab