Consider the following vectors representing the number of three-pointers made and attempted by a basketball player in five games: Three-Pointers Made: c(4, 5, 3, 6, 7) Three-Pointers Attempted: c(9, 10, 8, 11, 12)
Calculate the three-point shooting percentage for each game and select the correct average three-point shooting percentage for the five games.
X3PM<- c(4, 5, 3, 6, 7)
X3PA<- c(9, 10, 8, 11, 12)
X3PR<- (X3PM/X3PA)*100
X3PR
## [1] 44.44444 50.00000 37.50000 54.54545 58.33333
It was relatively simple getting the 3pt average for each of the game. Take the 3pt attempts made over the attempted and muliply by 100.
X3PR[2]
## [1] 50