Question: Write an R function which controls whether a given positive integer is a prime number. When your function is ready, apply your function with one

Write an R function which controls whether a given positive integer is a prime number. When your function is ready, apply your function with one prime number, one non-prime number, one non-integer value and one non-positive number and paste outputs to your document. Make sure your function works and produces logical outputs for these 4 different values. Hint: To see if x is a prime number or not, there is no need to test all the numbers which are less than x; it is enough to test the numbers between 2 and Va
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
