I want to modify the following R code based on the logical output of the function.
is_x_prime = function(x){
vapply(x, function(z) sum(t / 1:t == t %/% 1:t), integer(1L)) == 2L
}
so that if the output is:
if(TRUE)
{ cat("The number", x," is prime.")}
else
{ cat("The number", x," is not prime.")}
I was not able to combine them.
Thanks
Aucun commentaire:
Enregistrer un commentaire