Given a vector goals <- c(2, 3, 1, 4,2,0,1,4,3,2) that represents the number of goals scored per game, answer the following questions. After completing this activity using RStudio please share the link or upload your file to Canvas.

goals <- c(2, 3, 1, 4, 2, 0, 1, 4, 3, 2)

What is the total number of goals scored?

sum(goals)
[1] 22

What is the average number of goals scored per game?

mean(goals)

What is the maximum number number of goals scored in a single game?

max(goals)
[1] 4

What is the minimum number of goals scored in a single game?

min(goals)
[1] 0
LS0tCnRpdGxlOiAiRXhhbSIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQoKR2l2ZW4gYSB2ZWN0b3IgZ29hbHMgPC0gYygyLCAzLCAxLCA0LDIsMCwxLDQsMywyKSB0aGF0IHJlcHJlc2VudHMgdGhlIG51bWJlciBvZiBnb2FscyBzY29yZWQgcGVyIGdhbWUsIGFuc3dlciB0aGUgZm9sbG93aW5nIHF1ZXN0aW9ucy4gIEFmdGVyIGNvbXBsZXRpbmcgdGhpcyBhY3Rpdml0eSB1c2luZyBSU3R1ZGlvIHBsZWFzZSBzaGFyZSB0aGUgbGluayBvciB1cGxvYWQgeW91ciBmaWxlIHRvIENhbnZhcy4gCgpgYGB7cn0KZ29hbHMgPC0gYygyLCAzLCAxLCA0LCAyLCAwLCAxLCA0LCAzLCAyKQpgYGAKCldoYXQgaXMgdGhlIHRvdGFsIG51bWJlciBvZiBnb2FscyBzY29yZWQ/CmBgYHtyfQpzdW0oZ29hbHMpCmBgYAoKV2hhdCBpcyB0aGUgYXZlcmFnZSBudW1iZXIgb2YgZ29hbHMgc2NvcmVkIHBlciBnYW1lPwpgYGB7cn0KbWVhbihnb2FscykKYGBgCgpXaGF0IGlzIHRoZSBtYXhpbXVtIG51bWJlciBudW1iZXIgb2YgZ29hbHMgc2NvcmVkIGluIGEgc2luZ2xlIGdhbWU/CmBgYHtyfQptYXgoZ29hbHMpCmBgYAoKV2hhdCBpcyB0aGUgbWluaW11bSBudW1iZXIgb2YgZ29hbHMgc2NvcmVkIGluIGEgc2luZ2xlIGdhbWU/CgpgYGB7cn0KbWluKGdvYWxzKQpgYGAKCgoK