### 1. Create table ### col_head = c("Team","GP","W","D","L","GF","GA","GD","Pts") # Column headings teams = c("BDG","BRN","FDK","HKM","HAU","KFU","KRI","LLS", "MLD","ODD","ROS","SDF","SRP","SMG","TRM","VIK") # List of teams Tbl = matrix(0,nrow=length(teams),ncol=9) # Create empty table colnames(Tbl) <- col_head # Insert column headings Tbl[,1] = teams # Put teams in table table = data.frame(Tbl) # Convert to data frame # Change number columns to integer form # table$GP <- as.integer(table$GP) table$W <- as.integer(table$W) table$D <- as.integer(table$D) table$L <- as.integer(table$L) table$GF <- as.integer(table$GF) table$GA <- as.integer(table$GA) table$GD <- as.integer(table$GD) table$Pts <- as.integer(table$Pts) ### 2. Fill table ### ## Gameweek 1 ## # Odd 1 - Haugesund 2 # ODD = matrix(c(1,2),nrow=2) HAU = matrix(c(2,1),nrow=2) # Frederikstad 0 - Bodo/Glimt 2 # FDK = matrix(c(0,2),nrow=2) BDG = matrix(c(2,0),nrow=2) # Tromso 2 - Brann 4 # TRM = matrix(c(2,4),nrow=2) BRN = matrix(c(4,2),nrow=2) # Molde 4 - Stromsgodset 0 # MLD = matrix(c(4,0),nrow=2) SMG = matrix(c(0,4),nrow=2) # Rosenborg 2 - Sandefjord 0 # ROS = matrix(c(2,0),nrow=2) SDF = matrix(c(0,2),nrow=2) # Lillestrom 2 - Kristiansund 3 # LLS = matrix(c(2,3),nrow=2) KRI = matrix(c(3,2),nrow=2) # Viking 1 - Sarpsborg 0 # VIK = matrix(c(1,0),nrow=2) SRP = matrix(c(0,1),nrow=2) # KFUM 1 - HamKam 1 # KFU = matrix(c(1,1),nrow=2) HKM = matrix(c(1,1),nrow=2) ## Gameweek 2 ## # Bodo/Glimt 1 - Viking 0 # BDG = cbind(BDG,c(1,0)) VIK = cbind(VIK,c(0,1)) # Kristiansund 1 - KFUM 1 # KRI = cbind(KRI,c(1,1)) KFU = cbind(KFU,c(1,1)) # HamKam 0 - Molde 1 # HKM = cbind(HKM,c(0,1)) MLD = cbind(MLD,c(1,0)) # Haugesund 0 - Lillestrom 2 # HAU = cbind(HAU,c(0,2)) LLS = cbind(LLS,c(2,0)) # Sarpsborg 0 - Odd 1 # SRP = cbind(SRP,c(0,1)) ODD = cbind(ODD,c(1,0)) # Stromsgodset 1 - Rosenborg 0 # SMG = cbind(SMG,c(1,0)) ROS = cbind(ROS,c(0,1)) # Brann 0 - Fredrikstad 2 # BRN = cbind(BRN,c(0,2)) FDK = cbind(FDK,c(2,0)) ## Gameweek 3 ## # Fredrikstad 2 - Sarpsborg 2 # FDK = cbind(FDK,c(2,2)) SRP = cbind(SRP,c(2,2)) # Viking 1 - Brann 1 # VIK = cbind(VIK,c(1,1)) BRN = cbind(BRN,c(1,1)) # Tromso 0 - Haugesund 1 # TRM = cbind(TRM,c(0,1)) HAU = cbind(HAU,c(1,0)) # Molde 2 - Kristiansund 0 # MLD = cbind(MLD,c(2,0)) KRI = cbind(KRI,c(0,2)) # Rosenborg 1 - HamKam 0 # ROS = cbind(ROS,c(1,0)) HKM = cbind(HKM,c(0,1)) # Odd 2 - Sandefjord 2 # ODD = cbind(ODD,c(2,2)) SDF = cbind(SDF,c(2,2)) # Lillestrom 0 - Bodo/Glimt 5 # LLS = cbind(LLS,c(0,5)) BDG = cbind(BDG,c(5,0)) # KFUM 1 - Stromsgodset 3 # KFU = cbind(KFU,c(1,3)) SMG = cbind(SMG,c(3,1)) # Brann 1 - HamKam 0 # BRN = cbind(BRN,c(1,0)) HKM = cbind(HKM,c(0,1)) # Molde 1 - Odd 2 # MLD = cbind(MLD,c(1,2)) ODD = cbind(ODD,c(2,1)) ## Gameweek 4 ## # HamKam 0 - Stromsgodset 1 # HKM = cbind(HKM,c(0,1)) SMG = cbind(SMG,c(1,0)) # Sandefjord 0 - Lillestrom 1 # SDF = cbind(SDF,c(0,1)) LLS = cbind(LLS,c(1,0)) # Haugesund 1 - Rosenborg 3 # HAU = cbind(HAU,c(1,3)) ROS = cbind(ROS,c(3,1)) # Viking 1 - Fredrikstad 1 # VIK = cbind(VIK,c(1,1)) FDK = cbind(FDK,c(1,1)) # Kristiansund 1 - Tromso 0 # KRI = cbind(KRI,c(1,0)) TRM = cbind(TRM,c(0,1)) # Brann 2 - Odd 0 # BRN = cbind(BRN,c(2,0)) ODD = cbind(ODD,c(0,2)) # Sarpsborg 0 - KFUM 2 # SRP = cbind(SRP,c(0,2)) KFU = cbind(KFU,c(2,0)) # Bodo/Glimt 1 - Molde 1 # BDG = cbind(BDG,c(1,1)) MLD = cbind(MLD,c(1,1)) ## Gameweek 5 ## # Rosenborg 1 - Bodo/Glimt 3 # ROS = cbind(ROS,c(1,3)) BDG = cbind(BDG,c(3,1)) # Lillestrom 1 - HamKam 1 # LLS = cbind(LLS,c(1,1)) HKM = cbind(HKM,c(1,1)) # KFUM 0 - Brann 0 # KFU = cbind(KFU,c(0,0)) BRN = cbind(BRN,c(0,0)) # Molde 2 - Haugesund 1 # MLD = cbind(MLD,c(2,1)) HAU = cbind(HAU,c(1,2)) # Tromso 0 - Sarpsborg 3 # TRM = cbind(TRM,c(0,3)) SRP = cbind(SRP,c(3,0)) # Fredrikstad 1 - Sandefjord 0 # FDK = cbind(FDK,c(1,0)) SDF = cbind(SDF,c(0,1)) # Stromsgodset 2 - Kristiansund 2 # SMG = cbind(SMG,c(2,2)) KRI = cbind(KRI,c(2,2)) # Odd 3 - Viking 3 # ODD = cbind(ODD,c(3,3)) VIK = cbind(VIK,c(3,3)) ## Gameweek 6 ## # Brann 3 - Rosenborg 0 # BRN = cbind(BRN,c(3,0)) ROS = cbind(ROS,c(0,3)) # Odd 0 - Fredrikstad 2 # ODD = cbind(ODD,c(0,2)) FDK = cbind(FDK,c(2,0)) # Kristiansund 1 - HamKam 1 # KRI = cbind(KRI,c(1,1)) HKM = cbind(HKM,c(1,1)) # Sarpsborg 1 - Lillestrom 0 # SRP = cbind(SRP,c(1,0)) LLS = cbind(LLS,c(0,1)) # Bodo/Glimt 1 - Stromsgodset 0 # BDG = cbind(BDG,c(1,0)) SMG = cbind(SMG,c(0,1)) # Haugesund 0 - KFUM 1 # HAU = cbind(HAU,c(0,1)) KFU = cbind(KFU,c(1,0)) # Sandefjord 3 - Molde 1 # SDF = cbind(SDF,c(3,1)) MLD = cbind(MLD,c(1,3)) # Viking 2 - Tromso 1 # VIK = cbind(VIK,c(2,1)) TRM = cbind(TRM,c(1,2)) ## Gameweek 7 ## # Molde 2 - Rosenborg 2 # MLD = cbind(MLD,c(2,2)) ROS = cbind(ROS,c(2,2)) # Kristiansund 2 - Bodo/Glimt 4 # KRI = cbind(KRI,c(2,4)) BDG = cbind(BDG,c(4,2)) # KFUM 1 - Fredrikstad 4 # KFU = cbind(KFU,c(1,4)) FDK = cbind(FDK,c(4,1)) # Tromso 4 - Odd 0 # TRM = cbind(TRM,c(4,0)) ODD = cbind(ODD,c(0,4)) # Stromsgodset 0 - Viking 1 # SMG = cbind(SMG,c(0,1)) VIK = cbind(VIK,c(1,0)) # Sandefjord 4 - Sarpsborg 1 # SDF = cbind(SDF,c(4,1)) SRP = cbind(SRP,c(1,4)) # HamKam 2 - Haugesund 2 # HKM = cbind(HKM,c(2,2)) HAU = cbind(HAU,c(2,2)) # Lillestrom 0 - Brann 2 # LLS = cbind(LLS,c(0,2)) BRN = cbind(BRN,c(2,0)) ## Gameweek 8 ## # Brann 2 - Sandefjord 1 # BRN = cbind(BRN,c(2,1)) SDF = cbind(SDF,c(1,2)) # Sarpsborg 1 - HamKam 7 # SRP = cbind(SRP,c(1,7)) HKM = cbind(HKM,c(7,1)) # Haugesund 1 - Kristiansund 0 # HAU = cbind(HAU,c(1,0)) KRI = cbind(KRI,c(0,1)) # Odd 0 - Molde 4 # ODD = cbind(ODD,c(0,4)) MLD = cbind(MLD,c(4,0)) # Bodo/Glimt 4 - Tromso 0 # BDG = cbind(BDG,c(4,0)) TRM = cbind(TRM,c(0,4)) # Viking 1 - Lillestrom 4 # VIK = cbind(VIK,c(1,4)) LLS = cbind(LLS,c(4,1)) # Fredrikstad 4 - Stromsgodset 1 # FDK = cbind(FDK,c(4,1)) SMG = cbind(SMG,c(1,4)) # Rosenborg 1 - KFUM 3 # ROS = cbind(ROS,c(1,3)) KFU = cbind(KFU,c(3,1)) ## Gameweek 9 ## # Molde 2 - Sarpsborg 4 # MLD = cbind(MLD,c(2,4)) SRP = cbind(SRP,c(4,2)) # Sandefjord 0 - Viking 3 # SDF = cbind(SDF,c(0,3)) VIK = cbind(VIK,c(3,0)) # Stromsgodset 2 - Haugesund 0 # SMG = cbind(SMG,c(2,0)) HAU = cbind(HAU,c(0,2)) # KFUM 0 - Odd 0 # KFU = cbind(KFU,c(0,0)) ODD = cbind(ODD,c(0,0)) # HamKam 1 - Bodo/Glimt 0 # HKM = cbind(HKM,c(1,0)) BDG = cbind(BDG,c(0,1)) # Kristiansund 2 - Brann 2 # KRI = cbind(KRI,c(2,2)) BRN = cbind(BRN,c(2,2)) # Lillestrom 0 - Fredrikstad 3 # LLS = cbind(LLS,c(0,3)) FDK = cbind(FDK,c(3,0)) # Tromso 3 - Rosenborg 2 # TRM = cbind(TRM,c(3,2)) ROS = cbind(ROS,c(2,3)) ## Gameweek 10 ## # Bodo/Glimt 2 - KFUM 2 # BDG = cbind(BDG,c(2,2)) KFU = cbind(KFU,c(2,2)) # Fredrikstad 0 - Tromso 0 # FDK = cbind(FDK,c(0,0)) TRM = cbind(TRM,c(0,0)) # Sarpsborg 1 - Stromsgodset 3 # SRP = cbind(SRP,c(1,3)) SMG = cbind(SMG,c(3,1)) # Rosenborg 2 - Kristiansund 1 # ROS = cbind(ROS,c(2,1)) KRI = cbind(KRI,c(1,2)) # Viking 3 - HamKam 0 # VIK = cbind(VIK,c(3,0)) HKM = cbind(HKM,c(0,3)) # Odd 2 - Lillestrom 1 # ODD = cbind(ODD,c(2,1)) LLS = cbind(LLS,c(1,2)) # Haugesund 2 - Sandefjord 1 # HAU = cbind(HAU,c(2,1)) SDF = cbind(SDF,c(1,2)) # Brann 1 - Molde 3 # BRN = cbind(BRN,c(1,3)) MLD = cbind(MLD,c(3,1)) # Brann 2 - Kristiansund 1 # BRN = cbind(BRN,c(2,1)) KRI = cbind(KRI,c(1,2)) # Tromso 3 - Fredrikstad 0 # TRM = cbind(TRM,c(3,0)) FDK = cbind(FDK,c(0,3)) # Bodo/Glimt 1 - Sandefjord 1 # BDG = cbind(BDG,c(1,1)) SDF = cbind(SDF,c(1,1)) ## Gameweek 11 ## # HamKam 1 - Brann 2 # HKM = cbind(HKM,c(1,2)) BRN = cbind(BRN,c(2,1)) # Molde 2 - Viking 2 # MLD = cbind(MLD,c(2,2)) VIK = cbind(VIK,c(2,2)) # Stromsgodset 1 - Odd 1 # SMG = cbind(SMG,c(1,1)) ODD = cbind(ODD,c(1,1)) # Kristiansund 3 - Sarpsborg 1 # KRI = cbind(KRI,c(3,1)) SRP = cbind(SRP,c(1,3)) # KFUM 3 - Sandefjord 3 # KFU = cbind(KFU,c(3,3)) SDF = cbind(SDF,c(3,3)) # Haugesund 0 - Bodo/Glimt 1 # HAU = cbind(HAU,c(0,1)) BDG = cbind(BDG,c(1,0)) # Tromso 1 - Lillestrom 2 # TRM = cbind(TRM,c(1,2)) LLS = cbind(LLS,c(2,1)) # Rosenborg 1 - Fredrikstad 1 # ROS = cbind(ROS,c(1,1)) FDK = cbind(FDK,c(1,1)) ## Gameweek 12 ## # Sandefjord 1 - HamKam 2 # SDF = cbind(SDF,c(1,2)) HKM = cbind(HKM,c(2,1)) # Lillestrom 2 - KFUM 1 # LLS = cbind(LLS,c(2,1)) KFU = cbind(KFU,c(1,2)) # Brann 0 - Stromsgodset 0 # BRN = cbind(BRN,c(0,0)) SMG = cbind(SMG,c(0,0)) # Odd 1 - Kristiansund 1 # ODD = cbind(ODD,c(1,1)) KRI = cbind(KRI,c(1,1)) # Sarpsborg 1 - Bodo/Glimt 2 # SRP = cbind(SRP,c(1,2)) BDG = cbind(BDG,c(2,1)) # Tromso 0 - Molde 2 # TRM = cbind(TRM,c(0,2)) MLD = cbind(MLD,c(2,0)) # Viking 4 - Rosenborg 2 # VIK = cbind(VIK,c(4,2)) ROS = cbind(ROS,c(2,4)) # Sandefjord 1 - Tromso 2 # SDF = cbind(SDF,c(1,2)) TRM = cbind(TRM,c(2,1)) ## Gameweek 13 ## # Bodo/Glimt 5 - Brann 1 # BDG = cbind(BDG,c(5,1)) BRN = cbind(BRN,c(1,5)) # KFUM 1 - Viking 2 # KFU = cbind(KFU,c(1,2)) VIK = cbind(VIK,c(2,1)) # Haugesund 1 - Sarpsborg 2 # HAU = cbind(HAU,c(1,2)) SRP = cbind(SRP,c(2,1)) # HamKam 0 - Tromso 0 # HKM = cbind(HKM,c(0,0)) TRM = cbind(TRM,c(0,0)) # Molde 3 - Lillestrom 0 # MLD = cbind(MLD,c(3,0)) LLS = cbind(LLS,c(0,3)) # Rosenborg 2 - Odd 1 # ROS = cbind(ROS,c(2,1)) ODD = cbind(ODD,c(1,2)) # Stromsgodset 1 - Sandefjord 1 # SMG = cbind(SMG,c(1,1)) SDF = cbind(SDF,c(1,1)) # Kristiansund 3 - Fredrikstad 1 # KRI = cbind(KRI,c(3,1)) FDK = cbind(FDK,c(1,3)) ## Gameweek 14 ## # Sarpsborg 4 - Rosenborg 1 # SRP = cbind(SRP,c(4,1)) ROS = cbind(ROS,c(1,4)) # Viking 2 - Kristiansund 0 # VIK = cbind(VIK,c(2,0)) KRI = cbind(KRI,c(0,2)) # Sandefjord 2 - Bodo/Glimt 1 # SDF = cbind(SDF,c(2,1)) BDG = cbind(BDG,c(1,2)) # Odd 1 - HamKam 2 # ODD = cbind(ODD,c(1,2)) HKM = cbind(HKM,c(2,1)) # Lillestrom 3 - Stromsgodset 1 # LLS = cbind(LLS,c(3,1)) SMG = cbind(SMG,c(1,3)) # Fredrikstad 0 - Molde 0 # FDK = cbind(FDK,c(0,0)) MLD = cbind(MLD,c(0,0)) # Brann 1 - Haugesund 1 # BRN = cbind(BRN,c(1,1)) HAU = cbind(HAU,c(1,1)) # Tromso 1 - KFUM 2 # TRM = cbind(TRM,c(1,2)) KFU = cbind(KFU,c(2,1)) ## Gameweek 15 ## # Bodo/Glimt 3 - Odd 1 # BDG = cbind(BDG,c(3,1)) ODD = cbind(ODD,c(1,3)) # Sarpsborg 1 - Brann 1 # SRP = cbind(SRP,c(1,1)) BRN = cbind(BRN,c(1,1)) # Molde 2 - KFUM 3 # MLD = cbind(MLD,c(2,3)) KFU = cbind(KFU,c(3,2)) # Stromsgodset 0 - Tromso 1 # SMG = cbind(SMG,c(0,1)) TRM = cbind(TRM,c(1,0)) # HamKam 0 - Fredrikstad 1 # HKM = cbind(HKM,c(0,1)) FDK = cbind(FDK,c(1,0)) # Haugesund 1 - Viking 0 # HAU = cbind(HAU,c(1,0)) VIK = cbind(VIK,c(0,1)) ## Gameweek 16 ## # KFUM 1 - Bodo/Glimt 1 # KFU = cbind(KFU,c(1,1)) BDG = cbind(BDG,c(1,1)) # Fredrikstad 2 - Rosenborg 2 # FDK = cbind(FDK,c(2,2)) ROS = cbind(ROS,c(2,2)) # Tromso 0 - Kristiansund 0 # TRM = cbind(TRM,c(0,0)) KRI = cbind(KRI,c(0,0)) # Lillestrom 2 - Sarpsborg 2 # LLS = cbind(LLS,c(2,2)) SRP = cbind(SRP,c(2,2)) # Sandefjord 4 - Haugesund 3 # SDF = cbind(SDF,c(4,3)) HAU = cbind(HAU,c(3,4)) # Odd 2 - Stromsgodset 0 # ODD = cbind(ODD,c(2,0)) SMG = cbind(SMG,c(0,2)) # Viking 1 - Molde 0 # VIK = cbind(VIK,c(1,0)) MLD = cbind(MLD,c(0,1)) ## Gameweek 17 ## # Bodo/Glimt 4 - Haugesund 2 # BDG = cbind(BDG,c(4,2)) HAU = cbind(HAU,c(2,4)) # Stromsgodset 2 - Brann 3 # SMG = cbind(SMG,c(2,3)) BRN = cbind(BRN,c(3,2)) # Sarpsborg 2 - Sandefjord 1 # SRP = cbind(SRP,c(2,1)) SDF = cbind(SDF,c(1,2)) # Fredrikstad 0 - KFUM 0 # FDK = cbind(FDK,c(0,0)) KFU = cbind(KFU,c(0,0)) # Kristiansund 2 - Lillestrom 1 # KRI = cbind(KRI,c(2,1)) LLS = cbind(LLS,c(1,2)) # HamKam 3 - Viking 3 # HKM = cbind(HKM,c(3,3)) VIK = cbind(VIK,c(3,3)) # Rosenborg 1 - Tromso 0 # ROS = cbind(ROS,c(1,0)) TRM = cbind(TRM,c(0,1)) ## Gameweek 18 ## # Sandefjord 2 - Stromsgodset 2 # SDF = cbind(SDF,c(2,2)) SMG = cbind(SMG,c(2,2)) # Haugesund 0 - HamKam 1 # HAU = cbind(HAU,c(0,1)) HKM = cbind(HKM,c(1,0)) # Viking 1 - Bodo/Glimt 1 # VIK = cbind(VIK,c(1,1)) BDG = cbind(BDG,c(1,1)) # Odd 1 - Sarpsborg 1 # ODD = cbind(ODD,c(1,1)) SRP = cbind(SRP,c(1,1)) # KFUM 1 - Rosenborg 0 # KFU = cbind(KFU,c(1,0)) ROS = cbind(ROS,c(0,1)) # Lillestrom 1 - Molde 2 # LLS = cbind(LLS,c(1,2)) MLD = cbind(MLD,c(2,1)) # Fredrikstad 1 - Haugesund 0 # FDK = cbind(FDK,c(1,0)) HAU = cbind(HAU,c(0,1)) ## Gameweek 19 ## # Stromsgodset 3 - Lillestrom 2 # SMG = cbind(SMG,c(3,2)) LLS = cbind(LLS,c(2,3)) # Fredrikstad 0 - Brann 4 # FDK = cbind(FDK,c(0,4)) BRN = cbind(BRN,c(4,0)) # KFUM 0 - Tromso 1 # KFU = cbind(KFU,c(0,1)) TRM = cbind(TRM,c(1,0)) # HamKam 1 - Odd 0 # HKM = cbind(HKM,c(1,0)) ODD = cbind(ODD,c(0,1)) # Sarpsborg 2 - Haugesund 2 # SRP = cbind(SRP,c(2,2)) HAU = cbind(HAU,c(2,2)) # Rosenborg 2 - Viking 1 # ROS = cbind(ROS,c(2,1)) VIK = cbind(VIK,c(1,2)) # Rosenborg 4 - Lillestrom 0 # ROS = cbind(ROS,c(4,0)) LLS = cbind(LLS,c(0,4)) ## Gameweek 20 ## # Bodo/Glimt 6 - Sarpsborg 0 # BDG = cbind(BDG,c(6,0)) SRP = cbind(SRP,c(0,6)) # Lillestrom 0 - Tromso 1 # LLS = cbind(LLS,c(0,1)) TRM = cbind(TRM,c(1,0)) # Viking 5 - Stromsgodset 2 # VIK = cbind(VIK,c(5,2)) SMG = cbind(SMG,c(2,5)) # Haugesund 1 - Fredrikstad 0 # HAU = cbind(HAU,c(1,0)) FDK = cbind(FDK,c(0,1)) # Sandefjord 1 - Kristiansund 0 # SDF = cbind(SDF,c(1,0)) KRI = cbind(KRI,c(0,1)) # Molde 3 - HamKam 0 # MLD = cbind(MLD,c(3,0)) HKM = cbind(HKM,c(0,3)) # Odd 1 - Rosenborg 3 # ODD = cbind(ODD,c(1,3)) ROS = cbind(ROS,c(3,1)) ## Gameweek 21 ## # KFUM 2 - Lillestrom 0 # KFU = cbind(KFU,c(2,0)) LLS = cbind(LLS,c(0,2)) # Fredrikstad 2 - Odd 0 # FDK = cbind(FDK,c(2,0)) ODD = cbind(ODD,c(0,2)) # Rosenborg 2 - Molde 1 # ROS = cbind(ROS,c(2,1)) MLD = cbind(MLD,c(1,2)) # Kristiansund 2 - Haugesund 2 # KRI = cbind(KRI,c(2,2)) HAU = cbind(HAU,c(2,2)) # Stromgodset 0 - Bodo/Glimt 1 # SMG = cbind(SMG,c(0,1)) BDG = cbind(BDG,c(1,0)) # HamKam 1 - Sandefjord 1 # HKM = cbind(HKM,c(1,1)) SDF = cbind(SDF,c(1,1)) # Tromso 2 - Viking 2 # TRM = cbind(TRM,c(2,2)) VIK = cbind(VIK,c(2,2)) # Brann 1 - Sarpsborg 3 # BRN = cbind(BRN,c(1,3)) SRP = cbind(SRP,c(3,1)) ## Gameweek 22 ## # Bodo/Glimt 3 - HamKam 0 # BDG = cbind(BDG,c(3,0)) HKM = cbind(HKM,c(0,3)) # Viking 1 - KFUM 0 # VIK = cbind(VIK,c(1,0)) KFU = cbind(KFU,c(0,1)) # Molde 6 - Fredrikstad 1 # MLD = cbind(MLD,c(6,1)) FDK = cbind(FDK,c(1,6)) # Odd 1 - Tromso 0 # ODD = cbind(ODD,c(1,0)) TRM = cbind(TRM,c(0,1)) # Sandefjord 2 - Brann 2 # SDF = cbind(SDF,c(2,2)) BRN = cbind(BRN,c(2,2)) # Haugesund 0 - Stromsgodset 0 # HAU = cbind(HAU,c(0,0)) SMG = cbind(SMG,c(0,0)) # Sarpsborg 0 - Kristiansund 2 # SRP = cbind(SRP,c(0,2)) KRI = cbind(KRI,c(2,0)) # Lillestrom 1 - Rosenborg 1 # LLS = cbind(LLS,c(1,1)) ROS = cbind(ROS,c(1,1)) # Kristiansund 0 - Molde 4 # KRI = cbind(KRI,c(0,4)) MLD = cbind(MLD,c(4,0)) # Brann 2 - KFUM 0 # BRN = cbind(BRN,c(2,0)) KFU = cbind(KFU,c(0,2)) ## Gameweek 23 ## # Stromsgodset 2 - Sarpsborg 1 # SMG = cbind(SMG,c(2,1)) SRP = cbind(SRP,c(1,2)) # HamKam 5 - Lillestrom 0 # HKM = cbind(HKM,c(5,0)) LLS = cbind(LLS,c(0,5)) # Brann 4 - Bodo/Glimt 1 # BRN = cbind(BRN,c(4,1)) BDG = cbind(BDG,c(1,4)) # Rosenborg 4 - Haugesund 0 # ROS = cbind(ROS,c(4,0)) HAU = cbind(HAU,c(0,4)) # Kristiansund 0 - Odd 0 # KRI = cbind(KRI,c(0,0)) ODD = cbind(ODD,c(0,0)) # Tromso 3 - Sandefjord 0 # TRM = cbind(TRM,c(3,0)) SDF = cbind(SDF,c(0,3)) # Fredrikstad 3 - Viking 2 # FDK = cbind(FDK,c(3,2)) VIK = cbind(VIK,c(2,3)) # KFUM 1 - Molde 1 # KFU = cbind(KFU,c(1,1)) MLD = cbind(MLD,c(1,1)) ## Gameweek 24 ## # Molde 5 - Tromso 3 # MLD = cbind(MLD,c(5,3)) TRM = cbind(TRM,c(3,5)) # Haugesund 0 - Brann 1 # HAU = cbind(HAU,c(0,1)) BRN = cbind(BRN,c(1,0)) # Sarpsborg 0 - Fredrikstad 1 # SRP = cbind(SRP,c(0,1)) FDK = cbind(FDK,c(1,0)) # Stromsgodset 1 - HamKam 1 # SMG = cbind(SMG,c(1,1)) HKM = cbind(HKM,c(1,1)) # Lillestrom 1 - Viking 4 # LLS = cbind(LLS,c(1,4)) VIK = cbind(VIK,c(4,1)) # Odd 1 - KFUM 3 # ODD = cbind(ODD,c(1,3)) KFU = cbind(KFU,c(3,1)) # Bodo/Glimt 4 - Kristiansund 0 # BDG = cbind(BDG,c(4,0)) KRI = cbind(KRI,c(0,4)) # Sandefjord 0 - Rosenborg 1 # SDF = cbind(SDF,c(0,1)) ROS = cbind(ROS,c(1,0)) # Kristiansund 2 - Sandefjord 1 # KRI = cbind(KRI,c(2,1)) SDF = cbind(SDF,c(1,2)) ## Gameweek 25 ## # Molde 0 - Sandefjord 1 # MLD = cbind(MLD,c(0,1)) SDF = cbind(SDF,c(1,0)) # Tromso 0 - Bodo/Glimt 0 # TRM = cbind(TRM,c(0,0)) BDG = cbind(BDG,c(0,0)) # Rosenborg 1 - Brann 2 # ROS = cbind(ROS,c(1,2)) BRN = cbind(BRN,c(2,1)) # HamKam 0 - Sarpsborg 2 # HKM = cbind(HKM,c(0,2)) SRP = cbind(SRP,c(2,0)) # KFUM 0 - Haugesund 0 # KFU = cbind(KFU,c(0,0)) HAU = cbind(HAU,c(0,0)) # Viking 3 - Odd 3 # VIK = cbind(VIK,c(3,3)) ODD = cbind(ODD,c(3,3)) # Kristiansund 0 - Stromsgodset 0 # KRI = cbind(KRI,c(0,0)) SMG = cbind(SMG,c(0,0)) # Fredrikstad 2 - Lillestrom 1 # FDK = cbind(FDK,c(2,1)) LLS = cbind(LLS,c(1,2)) ## Gameweek 26 ## # Stromgodset 2 - Fredrikstad 0 # SMG = cbind(SMG,c(2,0)) FDK = cbind(FDK,c(0,2)) # HamKam 1 - Kristiansund 0 # HKM = cbind(HKM,c(1,0)) KRI = cbind(KRI,c(0,1)) # Lillestrom 3 - Odd 0 # LLS = cbind(LLS,c(3,0)) ODD = cbind(ODD,c(0,3)) # Sarpsborg 1 - Viking 2 # SRP = cbind(SRP,c(1,2)) VIK = cbind(VIK,c(2,1)) # Sandefjord 2 - KFUM 1 # SDF = cbind(SDF,c(2,1)) KFU = cbind(KFU,c(1,2)) # Haugesund 0 - Molde 3 # HAU = cbind(HAU,c(0,3)) MLD = cbind(MLD,c(3,0)) # Brann 4 - Tromso 0 # BRN = cbind(BRN,c(4,0)) TRM = cbind(TRM,c(0,4)) # Bodo/Glimt 2 - Rosenborg 3 # BDG = cbind(BDG,c(2,3)) ROS = cbind(ROS,c(3,2)) ## Gameweek 27 ## # Viking 3 - Sandefjord 2 # VIK = cbind(VIK,c(3,2)) SDF = cbind(SDF,c(2,3)) # Molde 3 - Bodo/Glimt 3 # MLD = cbind(MLD,c(3,3)) BDG = cbind(BDG,c(3,3)) # Fredrikstad 1 - Kristiansund 1 # FDK = cbind(FDK,c(1,1)) KRI = cbind(KRI,c(1,1)) # Lillestrom 0 - Haugesund 1 # LLS = cbind(LLS,c(0,1)) HAU = cbind(HAU,c(1,0)) # Tromso 3 - HamKam 3 # TRM = cbind(TRM,c(3,3)) HKM = cbind(HKM,c(3,3)) # KFUM 1 - Sarpsborg 2 # KFU = cbind(KFU,c(1,2)) SRP = cbind(SRP,c(2,1)) # Odd 0 - Brann 3 # ODD = cbind(ODD,c(0,3)) BRN = cbind(BRN,c(3,0)) # Rosenborg 1 - Stromsgodset 0 # ROS = cbind(ROS,c(1,0)) SMG = cbind(SMG,c(0,1)) ## Gameweek 28 ## # Brann 2 - Lillestrom 1 # BRN = cbind(BRN,c(2,1)) LLS = cbind(LLS,c(1,2)) # Haugesund 2 - Tromso 0 # HAU = cbind(HAU,c(2,0)) TRM = cbind(TRM,c(0,2)) # Kristiansund 0 - Viking 1 # KRI = cbind(KRI,c(0,1)) VIK = cbind(VIK,c(1,0)) # Stromsgodset 1 - KFUM 0 # SMG = cbind(SMG,c(1,0)) KFU = cbind(KFU,c(0,1)) # HamKam 0 - Rosenborg 2 # HKM = cbind(HKM,c(0,2)) ROS = cbind(ROS,c(2,0)) # Sandefjord 1 - Odd 0 # SDF = cbind(SDF,c(1,0)) ODD = cbind(ODD,c(0,1)) # Sarpsborg 2 - Molde 2 # SRP = cbind(SRP,c(2,2)) MLD = cbind(MLD,c(2,2)) # Bodo/Glimt 2 - Fredrikstad 2 # BDG = cbind(BDG,c(2,2)) FDK = cbind(FDK,c(2,2)) ## Gameweek 29 ## # Tromso 2 - Stromsgodset 0 # TRM = cbind(TRM,c(2,0)) SMG = cbind(SMG,c(0,2)) # Molde 2 - Brann 1 # MLD = cbind(MLD,c(2,1)) BRN = cbind(BRN,c(1,2)) # KFUM 1 - Kristiansund 2 # KFU = cbind(KFU,c(1,2)) KRI = cbind(KRI,c(2,1)) # Odd 0 - Bodo/Glimt 2 # ODD = cbind(ODD,c(0,2)) BDG = cbind(BDG,c(2,0)) # Rosenborg 1 - Sarpsborg 1 # ROS = cbind(ROS,c(1,1)) SRP = cbind(SRP,c(1,1)) # Viking 5 - Haugesund 1 # VIK = cbind(VIK,c(5,1)) HAU = cbind(HAU,c(1,5)) # Fredrikstad 1 - HamKam 0 # FDK = cbind(FDK,c(1,0)) HKM = cbind(HKM,c(0,1)) # Lillestrom 0 - Sandefjord 3 # LLS = cbind(LLS,c(0,3)) SDF = cbind(SDF,c(3,0)) ## Gameweek 30 ## # Bodo/Glimt 5 - Lillestrom 2 # BDG = cbind(BDG,c(5,2)) LLS = cbind(LLS,c(2,5)) # Brann 1 - Viking 1 # BRN = cbind(BRN,c(1,1)) VIK = cbind(VIK,c(1,1)) # HamKam 0 - KFUM 2 # HKM = cbind(HKM,c(0,2)) KFU = cbind(KFU,c(2,0)) # Haugesund 2 - Odd 1 # HAU = cbind(HAU,c(2,1)) ODD = cbind(ODD,c(1,2)) # Kristiansund 0 - Rosenborg 4 # KRI = cbind(KRI,c(0,4)) ROS = cbind(ROS,c(4,0)) # Sandefjord 0 - Fredrikstad 1 # SDF = cbind(SDF,c(0,1)) FDK = cbind(FDK,c(1,0)) # Sarpsborg 2 - Tromso 1 # SRP = cbind(SRP,c(2,1)) TRM = cbind(TRM,c(1,2)) # Stromsgodset 1 - Molde 0 # SMG = cbind(SMG,c(1,0)) MLD = cbind(MLD,c(0,1)) ### 3. Complete table ### for (x in teams) { r = which(table$Team==x) X = eval(parse(text=x)) for (i in 1:ncol(X)) { table$GP[r] = table$GP[r] + 1 if (X[1,i] - X[2,i] > 0) { table$W[r] = table$W[r] + 1 table$Pts[r] = table$Pts[r] + 3 } else if (X[1,i] == X[2,i]) { table$D[r] = table$D[r] + 1 table$Pts[r] = table$Pts[r] + 1 } else { table$L[r] = table$L[r] + 1 } } table$GF[r] = sum(X[1,]) table$GA[r] = sum(X[2,]) table$GD[r] = table$GF[r] - table$GA[r] } table <- table[order(-table$Pts,-table$GD,-table$GF,table$Team),] row.names(table) <- 1:nrow(table) table