number <- c(30, 35, 23, 9, 11, 27, 34, 6, 3, 0)
player <- c("Stephen Curry", "Kevin Durant", "Draymond Green", "Andre Iguodala", "Klay Thompson", 
            "Zaza Pachulia", "Shaun Livingston", "Nick Young", "David West", "Patrick McCaw")
position <- c("PG", "PF", "PF", "SF", "SG", "C", "PG", "SG", "C", "SG")
weight <- c("190", "240", "230", "215", "215", "270", "192", "210", "250", "185")
height <- c("6-3", "6-9", "6-7", "6-6", "6-7", "6-11", "6-7", "6-7", "6-9", "6-7")
birthdate <- c("March 14, 1988", "September 29, 1988", "March 4, 1990",
              "January 28, 1984", "February 8, 1990", "February 10, 1984", "September 11, 1985",
              "June 1, 1985", "August 29, 1980", "October 25, 1995")
experience <- c("8", "10", "5", "13", "6", "14", "12", "10", "14", "1")
College <- c("Davidson College", "University of Texas at Austin", 
             "Michigan State University", "University of Arizona", 
             "Washington State University", NA, NA, 
             "University of Southern California", "Xavier University", 
             "University of Nevada, Las Vegas")

player[which.max(weight)]
## [1] "Zaza Pachulia"
College[which(height == "6-6")]
## [1] "University of Arizona"
position[which.max(experience)]
## [1] "C"
number[which.min(weight)]
## [1] 0
table(position)
## position
##  C PF PG SF SG 
##  2  2  2  1  3
sum(as.numeric(weight) > mean(as.numeric(weight)))
## [1] 4
length(experience[as.numeric(experience) >= 9 & as.numeric(experience) <= 12])
## [1] 3
mean(as.numeric(experience)[position == "SG"])
## [1] 5.666667
median(as.numeric(weight)[position != "C"])
## [1] 212.5
quantile(as.numeric(experience)[position %in% c("PF", "SG")], 0.25)
## 25% 
##   5
gsw <- list(player = player, number = number, position = position, weight = weight, experience = experience)
gsw$number[which.max(as.numeric(gsw$weight))]
## [1] 27
gsw$position[which.min(as.numeric(gsw$experience))]
## [1] "SG"
length(gsw$experience[as.numeric(gsw$experience) < 8 | as.numeric(gsw$experience) > 11])
## [1] 7
quantile(as.numeric(gsw$experience)[gsw$position %in% c("PF", "SG")], 0.75)
## 75% 
##  10
gsw$player[which.max(abs(as.numeric(gsw$weight) - mean(as.numeric(gsw$weight))))]
## [1] "Zaza Pachulia"
hp <- list(
  first = "Harry",
  last = "Potter",
  courses = c("Potions", "Enchantments", "Spells"), 
  sport = "quidditch",
  age = 18L,
  gpa = 3.9
)

class(hp)
## [1] "list"
length(hp)
## [1] 6
length(hp$courses)
## [1] 3
typeof(hp$age)
## [1] "integer"
typeof(hp$gpa)
## [1] "double"
typeof(c(hp$age, hp$gpa))
## [1] "double"

true is seen as the value one so when added to 1 it should return 2

-2 is treated as a character because it is in parentheses so it will return false

because the first expression is false which returns zero, 0 is =<0 which is why it returns true

expression A evaluates to 1 because 1+0 is one and !2 is equal to false witch is 0 so the two expressions are not equivlant

this returns all true values because when using true it looks at each character at the index and returns the character

this returns na because the index that this function is looking for is out of the domain because of the inner function

this is sequence pattern that goes from the 9th element to the first element by two giving you t o e l v

this will search each index telling you if O is at each position either true or false

this condition checks if each position is either o or e and returns the values that are not equal to either o or d

this gives you the if a e i o u is present at each index giving you true at the values and false at the

this operation capitalizes words in lord that is not a voul

this function gets rid of all spaces and separators and leaves you with the result of Voldemort

this returns all false values because it checks if any value is missing so it returns all false

this adds all the true values if an Na is not present in the vector giving you a return of