Question: In R! Write a function named prime_factor(x) that will find the prime factorization of an integer x. The function will output a numeric vector. All
In R!
Write a function named prime_factor(x) that will find the prime factorization of an integer x. The function will output a numeric vector. All of the values in the output vector will be prime. The product of the numeric vector will be the original value x. There should be a check to make sure that the input value is a number greater than 2 with no decimal values with appropriate error messages. If youre stuck on getting started with this, I suggest doing some prime factorizations yourself. For example, try to find the prime factors of 171 or 364. Note the steps you go through to find these prime factors and see if you can create code to do it. (The point of the exercise is to give you practice writing code. Yes, I am aware that solutions to this problem already exist on the Internet. Dont search for them. While the problem is simple, it is complex enough that it is incredibly unlikely for students to create identical code solutions. You are free to talk about your approach and I fully expect many students to take identical approaches, but students writing identical code is an entirely different matter.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
