This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
y <- 1 for(i in 1:12){ y <-y*(i) } print(y) ## 479001600
vector <- seq(20,50,5) vector ## 20 25 30 35 40 45 50
factorial <- function(a,b,c){ pos_root <- (-b+(sqrt((b^2)-4ac))) / (2a) neg_root <- (-b-(sqrt((b^2)-4ac))) / (2a) print(pos_root) print(neg_root) } factorial(1,3,-28) #[1] 4 #[1] -7