Information Systems HW_3(1) - Ileana SiroisISYE 4530
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 the 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-("/Users/ileanasirois/Desktop/Fall 2021 Classes/ISYE 2530- Information & Data Systems/Lectures /Lecture 13/game_") #This is using directory of my computer. Just replace with your path head(NHL_Data) #ges("sqldf") library(sqldf) #ges("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. Shows the number of shots per period per game a team id for took. This study source was downloaded by from CourseH on :19:04 GMT -05:00 Ileana Sirois Shots_Avg_by_Team - sqldf("SELECT team_id_for, AVG(shot
Written for
- Institution
-
Rensselaer Polytechnic Institute
- Course
-
ISYE 4530
Document information
- Uploaded on
- November 1, 2022
- Number of pages
- 4
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
hw31 ileana sirois docx helpful unhelpful rensselaer polytechnic institute isye 4530