Information Technology > QUESTIONS & ANSWERS > Information Systems, HW_3(1) - Ileana Sirois ISYE 4530 (All)
Information Systems, Fall 2021 Homework 3. Due Thursday, November 4, 11:59 pm. This homework is done using R/R-Studio. Open the script containing the examples from the class of October 21. Run th... e script (no need to install/update the library if you did it before). Question 1 (5 points): Using existing variables from the class example, add the following: a) Find shots against/shots for ratio per team. Only include the code (no table) in the answer. (4 points) NHL_Data<-read.csv("/Users/ileanasirois/Desktop/Fall 2021 Classes/ISYE 2530- Information & Data Systems/Lectures /Lecture 13/game_plays.csv") #This is using directory of my computer. Just replace with your path head(NHL_Data) #install.packages("sqldf") library(sqldf) #update.packages("sqldf") # no need to install/update every time # Question 1 TeamsTable <- sqldf("SELECT DISTINCT team_id_for FROM NHL_Data WHERE team_id_for <> 'NA'") length(TeamsTable$team_id_for) #Counts distinct teams and excludes the NA that made it 33 variables now only 32 variables (teams) ShotsTable<-sqldf("SELECT game_id, period, team_id_for, count(event) as Shots FROM NHL_Data WHERE event = 'Shot' AND periodType = 'REGULAR' Group by game_id, period, team_id_for") # Creates a table with game id, period, team id for, and shots. S [Show More]
Last updated: 1 year ago
Preview 1 out of 4 pages
Connected school, study & course
About the document
Uploaded On
Nov 01, 2022
Number of pages
4
Written in
This document has been written for:
Uploaded
Nov 01, 2022
Downloads
0
Views
86
In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Browsegrades · High quality services·