# calc 12 factorial
fact12 = 1
for (i in 12:1)
{
fact12 <- (fact12 * i)
# print (fact12)
# print (i)
}
print (fact12)
## [1] 479001600
# calc 12 factorial
num_vector <- seq(from=20, to=50, by=5)
num_vector
## [1] 20 25 30 35 40 45 50
This is the quadratic equation: \(x = \frac {-b \pm \sqrt{b^2 - 4ac}} {2a}\)
Note: R code for displaying quadratic equation found on RMarkdown video
quadratic <- function(a,b,c)
{
x1 <- ((-b) + (sqrt((b^2- (4*(a*c))))))/(2*a)
print (x1)
x2 <- ((-b) - (sqrt((b^2- (4*(a*c))))))/(2*a)
print (x2)
}
quadratic (1,-2,-15)
## [1] 5
## [1] -3
Looking forward to your feedback! Thank you, Rick