Your today’s assignment is to develop a method in R that calculates the factorials of values in a given vector format. If the value is 0, the output should be 1; if the value is negative, the output...


Your today’s assignment is to develop a method in R that calculates the factorials of values in a given vector format. If the value is 0, the output should be 1; if the value is negative, the output should be "NA”; otherwise, the value will be the factorial of the value. Please note that you can’t use any built-in methods or libraries.


Test the function with this vector: my_values<-c(2, 5,="" -3,="" 0,="" 9,="">


Output will be: 2 120 NA 1 362880 24



Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here