## ----eval = FALSE-------------------------------------------------------------
# 2 + 2
# 6 - 4
# 3 * 6
# 4 / 8
# 2^3 #exponent
# 2 - 3 * 4
# (2 - 3) * 4 #parentheses change the order of operations
# sqrt(2) #square root
# 2^(1/2) #also square root
# pi
# sin(pi)
# exp(1) #e^1
# log(10) #natural log
# log(10, 10) #log base 10
## ----eval = FALSE-------------------------------------------------------------
# squareroot(2)
# sqrt 2
# sqrt(-2)
## ----eval = FALSE-------------------------------------------------------------
# sin(3 #hit ENTER
# ) #hit ENTER
# sin(3 #hit ENTER
# #hit ESC
## -----------------------------------------------------------------------------
a = 1
b <- 2
c <- 3
4 -> d
## -----------------------------------------------------------------------------
sum(c(1, 2, 3, 4))
## -----------------------------------------------------------------------------
crush <- function(name_1, name_2) {
print(paste(name_1, "LOVES", name_2))
}
crush(name_1 = "Ben", name_2 = "Melissa")
## -----------------------------------------------------------------------------
crush <- function(name_1 = "Ben", name_2 = "Melissa") {
print(paste(name_1, "LOVES", name_2))
}
crush()
## -----------------------------------------------------------------------------
crush("Elton", "David")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.