R Write Function Named Primefactor X Find Prime Factorization Integer X Function Output Nu Q43822059
In R!
Write a function named prime_factor(x) that will find the primefactorization of an integer x. The function will output a numericvector. All of the values in the output vector will be prime. Theproduct of the numeric vector will be the original value x. Thereshould be a check to make sure that the input value is a numbergreater than 2 with no decimal values with appropriate errormessages. If you’re stuck on getting started with this, I suggestdoing some prime factorizations yourself. For example, try to findthe prime factors of 171 or 364. Note the steps you go through tofind 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 theInternet. Don’t search for them. While the problem is simple, it iscomplex enough that it is incredibly unlikely for students tocreate identical code solutions. You are free to talk about yourapproach and I fully expect many students to take identicalapproaches, but students writing identical code is an entirelydifferent matter.)
Expert Answer
Answer to In R! Write a function named prime_factor(x) that will find the prime factorization of an integer x. The function will o…
OR