Syllabus, Last Week, Book and This Week
R - Script, Notebook and Markdown
GitHub
PRACTICE and QUIZ
Next Week
Extended Syllabus PDF
Week 4 - Presentation LINK
<-#
(Pg. 22-27)
Scroll down :)
Scientific Calculator
Class
Vectors
Matrices
Arrays
Scientific Calculator
Scientific Calculator
Problem: Compute double, triple or higher order integrals
install.packages("cubature")
library(cubature)
f <- function(x) 1
adaptIntegrate(f,lowerLimit = c(0,0,0),upperLimit = c(4,4,4))
$integral
[1] XX
Create a Function
Problem: Take a sample belonged to population and sum
pop <- 1:6 # This is my population
samp <- sample(pop, size = 2) # This is my sample, I choose two var.
sum(samp)
pop
samp
I want to create a new function named roll()
roll <- function() {
pop <- 1:6
samp <- sample(die, size = 2)
sum(samp)
}
roll()
Create a Function
Problem: What if we removed one line of code from our function and changed the name pop to box ?
roll2 <- function() {
samp <- sample(box, size = 2)
sum(samp)
}
roll2()
Re-create function
roll2 <- function(box) {
samp <- sample(box, size = 2)
sum(samp)
}
roll2(box = 1:4)
roll2(box = 1:6)
roll2(1:20)
Create a Function
print()
List - Data Frame - Attributes - ATMOS
Udemy – Introduction to R, Section 3 (Video 22-25)
List and Data Frame