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,="">-c(2,>
Output will be: 2 120 NA 1 362880 24
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here