##Question 1
6*7
## [1] 42
Creating variables and objects
x <-6
y <-7
z <- (x*y)
Calculate the log of z
log(z)
## [1] 3.73767
##Question 2
sum of variables x and y
sum(x,y)
## [1] 13
This is the sum function. It added the value of the two variables together, six plus 7 equals 13.
##Question 3
Create a vector named v made up of 2,4 and 6 then run v +5
v <- c(2,4,6)
v +5
## [1] 7 9 11
This added 5 to each of the mathematical values in the vector, 2+5 equals 7, 4+5 equals 9, 6 + 5 equals 11.
##Question 4
Create an object called favorite_movie Using STAR data file, calculate the median of the math variable.
STAR <- read.csv("STAR.csv")
View(STAR)
favorite_movie <- "Fools Rush In"
summary(STAR)
## classtype reading math graduated
## Length:1274 Min. :527.0 Min. :515.0 Min. :0.0000
## Class :character 1st Qu.:602.0 1st Qu.:604.0 1st Qu.:1.0000
## Mode :character Median :629.0 Median :631.0 Median :1.0000
## Mean :628.8 Mean :631.6 Mean :0.8697
## 3rd Qu.:654.0 3rd Qu.:659.0 3rd Qu.:1.0000
## Max. :753.0 Max. :774.0 Max. :1.0000
Math Median is 631.0