### 1. Create table ### col_head = c("Team","GP","W","D","L","GF","GA","GD","Pts") # Column headings teams = c("AIK","BRO","DJU","ELF","GAI","HAC","HAL","HAM", "GOT","NRK","IKV","KAL","MAL","MJA","SIR","VSK") # 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 ## # Norrkoping 1 - Malmo 5 # NRK = matrix(c(1,5),nrow=2) MAL = matrix(c(5,1),nrow=2) # GAIS 0 - IF Brommapojkarna 4 # GAI = matrix(c(0,4),nrow=2) BRO = matrix(c(4,0),nrow=2) # Hammarby 3 - Kalmar FF 1 # HAM = matrix(c(3,1),nrow=2) KAL = matrix(c(1,3),nrow=2) # Hacken 0 - Mjallby 1 # HAC = matrix(c(0,1),nrow=2) MJA = matrix(c(1,0),nrow=2) # Goteborg 1 - Djurgarden 4 # GOT = matrix(c(1,4),nrow=2) DJU = matrix(c(4,1),nrow=2) # Sirius 3 - Halmstad 0 # SIR = matrix(c(3,0),nrow=2) HAL = matrix(c(0,3),nrow=2) # AIK 1 - Vasteras 0 # AIK = matrix(c(1,0),nrow=2) VSK = matrix(c(0,1),nrow=2) # IF Elfsborg 2 - Varnamo 2 # ELF = matrix(c(2,2),nrow=2) IKV = matrix(c(2,2),nrow=2) ## Gameweek 2 ## # IF Brommapojkarna 2 - AIK 2 # BRO = cbind(BRO,c(2,2)) AIK = cbind(AIK,c(2,2)) # Mjallby 3 - Norrkoping 0 # MJA = cbind(MJA,c(3,0)) NRK = cbind(NRK,c(0,3)) # Malmo 2 - Hammarby 0 # MAL = cbind(MAL,c(2,0)) HAM = cbind(HAM,c(0,2)) # Halmstad 1 - Goteborg 0 # HAL = cbind(HAL,c(1,0)) GOT = cbind(GOT,c(0,1)) # Vasteras 0 - IF Elfsborg 1 # VSK = cbind(VSK,c(0,1)) ELF = cbind(ELF,c(1,0)) # Kalmar FF 1 - Sirius 2 # KAL = cbind(KAL,c(1,2)) SIR = cbind(SIR,c(2,1)) # Varnamo 1 - GAIS 2 # IKV = cbind(IKV,c(1,2)) GAI = cbind(GAI,c(2,1)) # Djurgarden 3 - Hacken 3 # DJU = cbind(DJU,c(3,3)) HAC = cbind(HAC,c(3,3)) ## Gameweek 3 ## # Mjallby 1 - AIK 1 # MJA = cbind(MJA,c(1,1)) AIK = cbind(AIK,c(1,1)) # Vasteras 0 - Halmstad 1 # VSK = cbind(VSK,c(0,1)) HAL = cbind(HAL,c(1,0)) # Kalmar FF 0 - Goteborg 1 # KAL = cbind(KAL,c(0,1)) GOT = cbind(GOT,c(1,0)) # Norrkoping 1 - GAIS 0 # NRK = cbind(NRK,c(1,0)) GAI = cbind(GAI,c(0,1)) # Djurgarden 2 - Sirius 0 # DJU = cbind(DJU,c(2,0)) SIR = cbind(SIR,c(0,2)) # Hacken 4 - IF Brommapojkarna 3 # HAC = cbind(HAC,c(4,3)) BRO = cbind(BRO,c(3,4)) # Varnamo 0 - Malmo 4 # IKV = cbind(IKV,c(0,4)) MAL = cbind(MAL,c(4,0)) # Hammarby 3 - IF Elfsborg 0 # HAM = cbind(HAM,c(3,0)) ELF = cbind(ELF,c(0,3)) ## Gameweek 4 ## # Sirius 0 - Varnamo 1 # SIR = cbind(SIR,c(0,1)) IKV = cbind(IKV,c(1,0)) # Goteborg 1 - Norrkoping 1 # GOT = cbind(GOT,c(1,1)) NRK = cbind(NRK,c(1,1)) # Malmo 1 - Vasteras 0 # MAL = cbind(MAL,c(1,0)) VSK = cbind(VSK,c(0,1)) # AIK 2 - Djurgarden 0 # AIK = cbind(AIK,c(2,0)) DJU = cbind(DJU,c(0,2)) # GAIS 2 - Mjallby 1 # GAI = cbind(GAI,c(2,1)) MJA = cbind(MJA,c(1,2)) # Halmstad 0 - IF Brommapojkarna 2 # HAL = cbind(HAL,c(0,2)) BRO = cbind(BRO,c(2,0)) # Hacken 2 - Hammarby 1 # HAC = cbind(HAC,c(2,1)) HAM = cbind(HAM,c(1,2)) # IF Elfsborg 1 - Kalmar FF 2 # ELF = cbind(ELF,c(1,2)) KAL = cbind(KAL,c(2,1)) ## Gameweek 5 ## # IF Brommapojkarna 1 - Sirius 1 # BRO = cbind(BRO,c(1,1)) SIR = cbind(SIR,c(1,1)) # AIK 2 - Varnamo 0 # AIK = cbind(AIK,c(2,0)) IKV = cbind(IKV,c(0,2)) # Goteborg 0 - Hacken 1 # GOT = cbind(GOT,c(0,1)) HAC = cbind(HAC,c(1,0)) # Djurgarden 0 - Malmo 1 # DJU = cbind(DJU,c(0,1)) MAL = cbind(MAL,c(1,0)) # Halmstad 2 - Hammarby 1 # HAL = cbind(HAL,c(2,1)) HAM = cbind(HAM,c(1,2)) # Kalmar FF 2 - GAIS 3 # KAL = cbind(KAL,c(2,3)) GAI = cbind(GAI,c(3,2)) # Vasteras 2 - Mjallby 1 # VSK = cbind(VSK,c(2,1)) MJA = cbind(MJA,c(1,2)) # Norrkoping 4 - IF Elfsborg 2 # NRK = cbind(NRK,c(4,2)) ELF = cbind(ELF,c(2,4)) ## Gameweek 6 ## # Varnamo 1 - Halmstad 3 # IKV = cbind(IKV,c(1,3)) HAL = cbind(HAL,c(3,1)) # Malmo 5 - AIK 0 # MAL = cbind(MAL,c(5,0)) AIK = cbind(AIK,c(0,5)) # Djurgarden 1 - GAIS 0 # DJU = cbind(DJU,c(1,0)) GAI = cbind(GAI,c(0,1)) # Hacken 1 - Norrkoping 2 # HAC = cbind(HAC,c(1,2)) NRK = cbind(NRK,c(2,1)) # IF Brommapojkarna 0 - Goteborg 3 # BRO = cbind(BRO,c(0,3)) GOT = cbind(GOT,c(3,0)) # Mjallby 3 - Kalmar FF 2 # MJA = cbind(MJA,c(3,2)) KAL = cbind(KAL,c(2,3)) # IF Elfsborg 2 - Sirius 0 # ELF = cbind(ELF,c(2,0)) SIR = cbind(SIR,c(0,2)) # Hammarby 2 - Vasteras 1 # HAM = cbind(HAM,c(2,1)) VSK = cbind(VSK,c(1,2)) ## Gameweek 7 ## # Mjallby 1 - IF Brommapojkarna 1 # MJA = cbind(MJA,c(1,1)) BRO = cbind(BRO,c(1,1)) # Kalmar FF 5 - Halmstad 2 # KAL = cbind(KAL,c(5,2)) HAL = cbind(HAL,c(2,5)) # Sirius 0 - Hacken 3 # SIR = cbind(SIR,c(0,3)) HAC = cbind(HAC,c(3,0)) # Vasteras 0 - Djurgarden 2 # VSK = cbind(VSK,c(0,2)) DJU = cbind(DJU,c(2,0)) # IF Elfsborg 3 - Malmo 1 # ELF = cbind(ELF,c(3,1)) MAL = cbind(MAL,c(1,3)) # Hammarby 1 - Varnamo 2 # HAM = cbind(HAM,c(1,2)) IKV = cbind(IKV,c(2,1)) # AIK 6 - Norrkoping 2 # AIK = cbind(AIK,c(6,2)) NRK = cbind(NRK,c(2,6)) # GAIS 2 - Goteborg 1 # GAI = cbind(GAI,c(2,1)) GOT = cbind(GOT,c(1,2)) ## Gameweek 8 ## # AIK 1 - Sirius 3 # AIK = cbind(AIK,c(1,3)) SIR = cbind(SIR,c(3,1)) # Halmstad 1 - Mjallby 3 # HAL = cbind(HAL,c(1,3)) MJA = cbind(MJA,c(3,1)) # GAIS 2 - Vasteras 0 # GAI = cbind(GAI,c(2,0)) VSK = cbind(VSK,c(0,2)) # Hacken 3 - Kalmar FF 1 # HAC = cbind(HAC,c(3,1)) KAL = cbind(KAL,c(1,3)) # Norrkoping 1 - Hammarby 2 # NRK = cbind(NRK,c(1,2)) HAM = cbind(HAM,c(2,1)) # Djurgarden 2 - IF Elfsborg 0 # DJU = cbind(DJU,c(2,0)) ELF = cbind(ELF,c(0,2)) # Varnamo 1 - IF Brommapojkarna 1 # IKV = cbind(IKV,c(1,1)) BRO = cbind(BRO,c(1,1)) # Goteborg 0 - Malmo 3 # GOT = cbind(GOT,c(0,3)) MAL = cbind(MAL,c(3,0)) ## Gameweek 9 ## # IF Elfsborg 6 - AIK 1 # ELF = cbind(ELF,c(6,1)) AIK = cbind(AIK,c(1,6)) # Mjallby 3 - Hammarby 0 # MJA = cbind(MJA,c(3,0)) HAM = cbind(HAM,c(0,3)) # Halmstad 3 - Hacken 0 # HAL = cbind(HAL,c(3,0)) HAC = cbind(HAC,c(0,3)) # Vasteras 0 - Varnamo 2 # VSK = cbind(VSK,c(0,2)) IKV = cbind(IKV,c(2,0)) # Malmo 1 - GAIS 0 # MAL = cbind(MAL,c(1,0)) GAI = cbind(GAI,c(0,1)) # Kalmar FF 1 - Norrkoping 1 # KAL = cbind(KAL,c(1,1)) NRK = cbind(NRK,c(1,1)) # Sirius 2 - Goteborg 2 # SIR = cbind(SIR,c(2,2)) GOT = cbind(GOT,c(2,2)) # IF Brommapojkarna 0 - Djurgarden 5 # BRO = cbind(BRO,c(0,5)) DJU = cbind(DJU,c(5,0)) ## Gameweek 10 ## # IF Brommapojkarna 2 - Norrkoping 1 # BRO = cbind(BRO,c(2,1)) NRK = cbind(NRK,c(1,2)) # Hammarby 2 - AIK 1 # HAM = cbind(HAM,c(2,1)) AIK = cbind(AIK,c(1,2)) # Varnamo 0 - Kalmar FF 2 # IKV = cbind(IKV,c(0,2)) KAL = cbind(KAL,c(2,0)) # GAIS 2 - IF Elfsborg 1 # GAI = cbind(GAI,c(2,1)) ELF = cbind(ELF,c(1,2)) # Djurgarden 2 - Halmstad 0 # DJU = cbind(DJU,c(2,0)) HAL = cbind(HAL,c(0,2)) # Sirius 0 - Vasteras 0 # SIR = cbind(SIR,c(0,0)) VSK = cbind(VSK,c(0,0)) # Hacken 2 - Malmo 2 # HAC = cbind(HAC,c(2,2)) MAL = cbind(MAL,c(2,2)) # Goteborg 1 - Mjallby 0 # GOT = cbind(GOT,c(1,0)) MJA = cbind(MJA,c(0,1)) ## Gameweek 11 ## # Malmo 5 - Kalmar FF 0 # MAL = cbind(MAL,c(5,0)) KAL = cbind(KAL,c(0,5)) # IF Elfsborg 2 - Halmstad 0 # ELF = cbind(ELF,c(2,0)) HAL = cbind(HAL,c(0,2)) # GAIS 3 - Hacken 0 # GAI = cbind(GAI,c(3,0)) HAC = cbind(HAC,c(0,3)) # Mjallby 1 - Djurgarden 3 # MJA = cbind(MJA,c(1,3)) DJU = cbind(DJU,c(3,1)) # Hammarby 3 - Sirius 0 # HAM = cbind(HAM,c(3,0)) SIR = cbind(SIR,c(0,3)) # Vasteras 1 - IF Brommapojkarna 1 # VSK = cbind(VSK,c(1,1)) BRO = cbind(BRO,c(1,1)) # Norrkoping 0 - Varnamo 4 # NRK = cbind(NRK,c(0,4)) IKV = cbind(IKV,c(4,0)) # AIK 5 - Goteborg 2 # AIK = cbind(AIK,c(5,2)) GOT = cbind(GOT,c(2,5)) # Malmo 2 - IF Elfsborg 1 # MAL = cbind(MAL,c(2,1)) ELF = cbind(ELF,c(1,2)) # Mjallby 2 - Hacken 1 # MJA = cbind(MJA,c(2,1)) HAC = cbind(HAC,c(1,2)) ## Gameweek 12 ## # IF Brommapojkarna 2 - Malmo 2 # BRO = cbind(BRO,c(2,2)) MAL = cbind(MAL,c(2,2)) # Goteborg 1 - IF Elfsborg 0 # GOT = cbind(GOT,c(1,0)) ELF = cbind(ELF,c(0,1)) # Halmstad 4 - GAIS 0 # HAL = cbind(HAL,c(4,0)) GAI = cbind(GAI,c(0,4)) # Sirius 5 - Norrkoping 1 # SIR = cbind(SIR,c(5,1)) NRK = cbind(NRK,c(1,5)) # Djurgarden 0 - Hammarby 3 # DJU = cbind(DJU,c(0,3)) HAM = cbind(HAM,c(3,0)) # Kalmar FF 0 - Vasteras 4 # KAL = cbind(KAL,c(0,4)) VSK = cbind(VSK,c(4,0)) # Hacken 4 - AIK 1 # HAC = cbind(HAC,c(4,1)) AIK = cbind(AIK,c(1,4)) # Varnamo 1 - Mjallby 2 # IKV = cbind(IKV,c(1,2)) MJA = cbind(MJA,c(2,1)) ## Gameweek 13 ## # Mjallby 3 - Sirius 2 # MJA = cbind(MJA,c(3,2)) SIR = cbind(SIR,c(2,3)) # IF Elfsborg 3 - IF Brommapojkarna 0 # ELF = cbind(ELF,c(3,0)) BRO = cbind(BRO,c(0,3)) # Varnamo 2 - Goteborg 0 # IKV = cbind(IKV,c(2,0)) GOT = cbind(GOT,c(0,2)) # AIK 1 - Kalmar FF 2 # AIK = cbind(AIK,c(1,2)) KAL = cbind(KAL,c(2,1)) # Malmo 5 - Halmstad 1 # MAL = cbind(MAL,c(5,1)) HAL = cbind(HAL,c(1,5)) # GAIS 0 - Hammarby 0 # GAI = cbind(GAI,c(0,0)) HAM = cbind(HAM,c(0,0)) # Norrkoping 1 - Djurgarden 3 # NRK = cbind(NRK,c(1,3)) DJU = cbind(DJU,c(3,1)) # Vasteras 1 - Hacken 2 # VSK = cbind(VSK,c(1,2)) HAC = cbind(HAC,c(2,1)) ## Gameweek 14 ## # Mjallby 2 - Malmo 1 # MJA = cbind(MJA,c(2,1)) MAL = cbind(MAL,c(1,2)) # Sirius 3 - GAIS 1 # SIR = cbind(SIR,c(3,1)) GAI = cbind(GAI,c(1,3)) # Djurgarden 1 - Varnamo 0 # DJU = cbind(DJU,c(1,0)) IKV = cbind(IKV,c(0,1)) # Hacken 3 - IF Elfsborg 5 # HAC = cbind(HAC,c(3,5)) ELF = cbind(ELF,c(5,3)) # Kalmar FF 0 - IF Brommapojkarna 1 # KAL = cbind(KAL,c(0,1)) BRO = cbind(BRO,c(1,0)) # Vasteras 2 - Norrkoping 1 # VSK = cbind(VSK,c(2,1)) NRK = cbind(NRK,c(1,2)) # Hammarby 0 - Goteborg 1 # HAM = cbind(HAM,c(0,1)) GOT = cbind(GOT,c(1,0)) # Halmstad 1 - AIK 2 # HAL = cbind(HAL,c(1,2)) AIK = cbind(AIK,c(2,1)) ## Gameweek 15 ## # Sirius 3 - Malmo 4 # SIR = cbind(SIR,c(3,4)) MAL = cbind(MAL,c(4,3)) # Varnamo 2 - Hacken 2 # IKV = cbind(IKV,c(2,2)) HAC = cbind(HAC,c(2,2)) # Kalmar FF 2 - Djurgarden 1 # KAL = cbind(KAL,c(2,1)) DJU = cbind(DJU,c(1,2)) # IF Brommapojkarna 0 - Hammarby 2 # BRO = cbind(BRO,c(0,2)) HAM = cbind(HAM,c(2,0)) # Norrkoping 1 - Halmstad 0 # NRK = cbind(NRK,c(1,0)) HAL = cbind(HAL,c(0,1)) # IF Elfsborg 3 - Mjallby 1 # ELF = cbind(ELF,c(3,1)) MJA = cbind(MJA,c(1,3)) # Goteborg 1 - Vasteras 1 # GOT = cbind(GOT,c(1,1)) VSK = cbind(VSK,c(1,1)) # GAIS 2 - AIK 0 # GAI = cbind(GAI,c(2,0)) AIK = cbind(AIK,c(0,2)) ## Gameweek 16 ## # Norrkoping 2 - Kalmar FF 0 # NRK = cbind(NRK,c(2,0)) KAL = cbind(KAL,c(0,2)) # Malmo 0 - Sirius 1 # MAL = cbind(MAL,c(0,1)) SIR = cbind(SIR,c(1,0)) # Goteborg 3 - IF Brommapojkarna 4 # GOT = cbind(GOT,c(3,4)) BRO = cbind(BRO,c(4,3)) # Halmstad 1 - Varnamo 0 # HAL = cbind(HAL,c(1,0)) IKV = cbind(IKV,c(0,1)) # Hammarby 3 - Mjallby 0 # HAM = cbind(HAM,c(3,0)) MJA = cbind(MJA,c(0,3)) # Hacken 4 - Vasteras 0 # HAC = cbind(HAC,c(4,0)) VSK = cbind(VSK,c(0,4)) # IF Elfsborg 1 - Djurgarden 2 # ELF = cbind(ELF,c(1,2)) DJU = cbind(DJU,c(2,1)) # AIK 0 - GAIS 1 # AIK = cbind(AIK,c(0,1)) GAI = cbind(GAI,c(1,0)) ## Gameweek 17 ## # Vasteras 1 - AIK 2 # VSK = cbind(VSK,c(1,2)) AIK = cbind(AIK,c(2,1)) # GAIS 0 - Norrkoping 1 # GAI = cbind(GAI,c(0,1)) NRK = cbind(NRK,c(1,0)) # IF Brommapojkarna 4 - Halmstad 1 # BRO = cbind(BRO,c(4,1)) HAL = cbind(HAL,c(1,4)) # Varnamo 2 - Sirius 4 # IKV = cbind(IKV,c(2,4)) SIR = cbind(SIR,c(4,2)) # Djurgarden 1 - Goteborg 1 # DJU = cbind(DJU,c(1,1)) GOT = cbind(GOT,c(1,1)) # Kalmar FF 1 - Hammarby 4 # KAL = cbind(KAL,c(1,4)) HAM = cbind(HAM,c(4,1)) ## Gameweek 18 ## # Norrkoping 2 - Vasteras 1 # NRK = cbind(NRK,c(2,1)) VSK = cbind(VSK,c(1,2)) # Halmstad 0 - Malmo 1 # HAL = cbind(HAL,c(0,1)) MAL = cbind(MAL,c(1,0)) # Goteborg 0 - Varnamo 0 # GOT = cbind(GOT,c(0,0)) IKV = cbind(IKV,c(0,0)) # AIK 1 - Mjallby 0 # AIK = cbind(AIK,c(1,0)) MJA = cbind(MJA,c(0,1)) # IF Elfsborg 2 - GAIS 1 # ELF = cbind(ELF,c(2,1)) GAI = cbind(GAI,c(1,2)) # Sirius 3 - Kalmar FF 1 # SIR = cbind(SIR,c(3,1)) KAL = cbind(KAL,c(1,3)) # Hammarby 3 - IF Brommapojkarna 3 # HAM = cbind(HAM,c(3,3)) BRO = cbind(BRO,c(3,3)) ## Gameweek 19 ## # Goteborg 1 - Sirius 1 # GOT = cbind(GOT,c(1,1)) SIR = cbind(SIR,c(1,1)) # Varnamo 0 - Hammarby 3 # IKV = cbind(IKV,c(0,3)) HAM = cbind(HAM,c(3,0)) # Malmo 2 - Norrkoping 1 # MAL = cbind(MAL,c(2,1)) NRK = cbind(NRK,c(1,2)) # Vasteras 2 - Kalmar FF 1 # VSK = cbind(VSK,c(2,1)) KAL = cbind(KAL,c(1,2)) # Djurgarden 0 - AIK 2 # DJU = cbind(DJU,c(0,2)) AIK = cbind(AIK,c(2,0)) # IF Brommapojkarna 1 - Hacken 3 # BRO = cbind(BRO,c(1,3)) HAC = cbind(HAC,c(3,1)) # Mjallby 1 - IF Elfsborg 1 # MJA = cbind(MJA,c(1,1)) ELF = cbind(ELF,c(1,1)) # GAIS 3 - Halmstad 1 # GAI = cbind(GAI,c(3,1)) HAL = cbind(HAL,c(1,3)) ## Gameweek 20 ## # Kalmar FF 2 - Malmo 2 # KAL = cbind(KAL,c(2,2)) MAL = cbind(MAL,c(2,2)) # Sirius 0 - Djurgarden 1 # SIR = cbind(SIR,c(0,1)) DJU = cbind(DJU,c(1,0)) # IF Elfsborg 3 - Goteborg 1 # ELF = cbind(ELF,c(3,1)) GOT = cbind(GOT,c(1,3)) # Hacken 1 - Varnamo 1 # HAC = cbind(HAC,c(1,1)) IKV = cbind(IKV,c(1,1)) # AIK 2 - IF Brommapojkarna 1 # AIK = cbind(AIK,c(2,1)) BRO = cbind(BRO,c(1,2)) # Hammarby 0 - GAIS 0 # HAM = cbind(HAM,c(0,0)) GAI = cbind(GAI,c(0,0)) # Halmstad 0 - Vasteras 1 # HAL = cbind(HAL,c(0,1)) VSK = cbind(VSK,c(1,0)) # Norrkoping 1 - Mjallby 2 # NRK = cbind(NRK,c(1,2)) MJA = cbind(MJA,c(2,1)) ## Gameweek 21 ## # GAIS 1 - Kalmar FF 1 # GAI = cbind(GAI,c(1,1)) KAL = cbind(KAL,c(1,1)) # Varnamo 0 - AIK 1 # IKV = cbind(IKV,c(0,1)) AIK = cbind(AIK,c(1,0)) # Vasteras 1 - Sirius 2 # VSK = cbind(VSK,c(1,2)) SIR = cbind(SIR,c(2,1)) # Mjallby 3 - Halmstad 1 # MJA = cbind(MJA,c(3,1)) HAL = cbind(HAL,c(1,3)) # Malmo 4 - Djurgarden 0 # MAL = cbind(MAL,c(4,0)) DJU = cbind(DJU,c(0,4)) # IF Brommapojkarna 3 - IF Elfsborg 3 # BRO = cbind(BRO,c(3,3)) ELF = cbind(ELF,c(3,3)) # Goteborg 0 - Hammarby 1 # GOT = cbind(GOT,c(0,1)) HAM = cbind(HAM,c(1,0)) # Norrkoping 3 - Hacken 3 # NRK = cbind(NRK,c(3,3)) HAC = cbind(HAC,c(3,3)) ## Gameweek 22 ## # Vasteras 2 - GAIS 3 # VSK = cbind(VSK,c(2,3)) GAI = cbind(GAI,c(3,2)) # AIK 0 - Malmo 0 # AIK = cbind(AIK,c(0,0)) MAL = cbind(MAL,c(0,0)) # Sirius 3 - IF Brommapojkarna 2 # SIR = cbind(SIR,c(3,2)) BRO = cbind(BRO,c(2,3)) # Djurgarden 1 - Mjallby 1 # DJU = cbind(DJU,c(1,1)) MJA = cbind(MJA,c(1,1)) # Hacken 3 - Goteborg 3 # HAC = cbind(HAC,c(3,3)) GOT = cbind(GOT,c(3,3)) # Halmstad 0 - IF Elfsborg 1 # HAL = cbind(HAL,c(0,1)) ELF = cbind(ELF,c(1,0)) # Kalmar FF 3 - Varnamo 1 # KAL = cbind(KAL,c(3,1)) IKV = cbind(IKV,c(1,3)) # Hammarby 1 - Norrkoping 1 # HAM = cbind(HAM,c(1,1)) NRK = cbind(NRK,c(1,1)) # GAIS 0 - Malmo 0 # GAI = cbind(GAI,c(0,0)) MAL = cbind(MAL,c(0,0)) # Hacken 1 - Djurgarden 2 # HAC = cbind(HAC,c(1,2)) DJU = cbind(DJU,c(2,1)) # IF Elfsborg 2 - Norrkoping 2 # ELF = cbind(ELF,c(2,2)) NRK = cbind(NRK,c(2,2)) ## Gameweek 23 ## # Kalmar FF 0 - AIK 1 # KAL = cbind(KAL,c(0,1)) AIK = cbind(AIK,c(1,0)) # IF Brommapojkarna 0 - Mjallby 0 # BRO = cbind(BRO,c(0,0)) MJA = cbind(MJA,c(0,0)) # GAIS 3 - Djurgarden 0 # GAI = cbind(GAI,c(3,0)) DJU = cbind(DJU,c(0,3)) # IF Elfsborg 0 - Hammarby 0 # ELF = cbind(ELF,c(0,0)) HAM = cbind(HAM,c(0,0)) # Varnamo 2 - Vasteras 0 # IKV = cbind(IKV,c(2,0)) VSK = cbind(VSK,c(0,2)) # Malmo 4 - Hacken 0 # MAL = cbind(MAL,c(4,0)) HAC = cbind(HAC,c(0,4)) # Goteborg 1 - Halmstad 1 # GOT = cbind(GOT,c(1,1)) HAL = cbind(HAL,c(1,1)) ## Gameweek 24 ## # Djurgarden 2 - IF Brommapojkarna 1 # DJU = cbind(DJU,c(2,1)) BRO = cbind(BRO,c(1,2)) # Sirius 0 - AIK 1 # SIR = cbind(SIR,c(0,1)) AIK = cbind(AIK,c(1,0)) # Mjallby 1 - Varnamo 1 # MJA = cbind(MJA,c(1,1)) IKV = cbind(IKV,c(1,1)) # Vasteras 1 - Goteborg 1 # VSK = cbind(VSK,c(1,1)) GOT = cbind(GOT,c(1,1)) # Halmstad 2 - Kalmar FF 2 # HAL = cbind(HAL,c(2,2)) KAL = cbind(KAL,c(2,2)) # Hammarby 2 - Hacken 0 # HAM = cbind(HAM,c(2,0)) HAC = cbind(HAC,c(0,2)) ## Gameweek 25 ## # Halmstad 0 - Norrkoping 0 # HAL = cbind(HAL,c(0,0)) NRK = cbind(NRK,c(0,0)) # AIK 1 - Hammarby 0 # AIK = cbind(AIK,c(1,0)) HAM = cbind(HAM,c(0,1)) # Varnamo 1 - Djurgarden 1 # IKV = cbind(IKV,c(1,1)) DJU = cbind(DJU,c(1,1)) # Malmo 2 - Mjallby 0 # MAL = cbind(MAL,c(2,0)) MJA = cbind(MJA,c(0,2)) # Hacken 2 - Sirius 0 # HAC = cbind(HAC,c(2,0)) SIR = cbind(SIR,c(0,2)) # Kalmar FF 1 - IF Elfsborg 3 # KAL = cbind(KAL,c(1,3)) ELF = cbind(ELF,c(3,1)) # IF Brommapojkarna 2 - Vasteras 1 # BRO = cbind(BRO,c(2,1)) VSK = cbind(VSK,c(1,2)) # Goteborg 2 - GAIS 0 # GOT = cbind(GOT,c(2,0)) GAI = cbind(GAI,c(0,2)) # Norrkoping 0 - Sirius 2 # NRK = cbind(NRK,c(0,2)) SIR = cbind(SIR,c(2,0)) ## Gameweek 26 ## # Mjallby 2 - Vasteras 1 # MJA = cbind(MJA,c(2,1)) VSK = cbind(VSK,c(1,2)) # Hammarby 1 - Halmstad 0 # HAM = cbind(HAM,c(1,0)) HAL = cbind(HAL,c(0,1)) # IF Brommapojkarna 2 - GAIS 0 # BRO = cbind(BRO,c(2,0)) GAI = cbind(GAI,c(0,2)) # AIK 0 - Hacken 2 # AIK = cbind(AIK,c(0,2)) HAC = cbind(HAC,c(2,0)) # Djurgarden 1 - Kalmar FF 1 # DJU = cbind(DJU,c(1,1)) KAL = cbind(KAL,c(1,1)) # Malmo 1 - Varnamo 1 # MAL = cbind(MAL,c(1,1)) IKV = cbind(IKV,c(1,1)) # Norrkoping 0 - Goteborg 2 # NRK = cbind(NRK,c(0,2)) GOT = cbind(GOT,c(2,0)) # Sirius 4 - IF Elfsborg 1 # SIR = cbind(SIR,c(4,1)) ELF = cbind(ELF,c(1,4)) ## Gameweek 27 ## # Vasteras 1 - Malmo 1 # VSK = cbind(VSK,c(1,1)) MAL = cbind(MAL,c(1,1)) # IF Elfsborg 1 - Hacken 3 # ELF = cbind(ELF,c(1,3)) HAC = cbind(HAC,c(3,1)) # Halmstad 3 - Sirius 1 # HAL = cbind(HAL,c(3,1)) SIR = cbind(SIR,c(1,3)) # Kalmar FF 0 - Mjallby 3 # KAL = cbind(KAL,c(0,3)) MJA = cbind(MJA,c(3,0)) # GAIS 0 - Varnamo 0 # GAI = cbind(GAI,c(0,0)) IKV = cbind(IKV,c(0,0)) # Hammarby 2 - Djurgarden 0 # HAM = cbind(HAM,c(2,0)) DJU = cbind(DJU,c(0,2)) # Norrkoping 1 - IF Brommapojkarna 1 # NRK = cbind(NRK,c(1,1)) BRO = cbind(BRO,c(1,1)) # Goteborg 1 - AIK 2 # GOT = cbind(GOT,c(1,2)) AIK = cbind(AIK,c(2,1)) ## Gameweek 28 ## # Sirius 0 - Hammarby 3 # SIR = cbind(SIR,c(0,3)) HAM = cbind(HAM,c(3,0)) # Mjallby 1 - GAIS 1 # MJA = cbind(MJA,c(1,1)) GAI = cbind(GAI,c(1,1)) # IF Brommapojkarna 1 - Kalmar FF 2 # BRO = cbind(BRO,c(1,2)) KAL = cbind(KAL,c(2,1)) # Varnamo 1 - Norrkoping 2 # IKV = cbind(IKV,c(1,2)) NRK = cbind(NRK,c(2,1)) # AIK 2 - IF Elfsborg 1 # AIK = cbind(AIK,c(2,1)) ELF = cbind(ELF,c(1,2)) # Hacken 0 - Halmstad 1 # HAC = cbind(HAC,c(0,1)) HAL = cbind(HAL,c(1,0)) # Djurgarden 2 - Vasteras 1 # DJU = cbind(DJU,c(2,1)) VSK = cbind(VSK,c(1,2)) # Malmo 2 - Goteborg 1 # MAL = cbind(MAL,c(2,1)) GOT = cbind(GOT,c(1,2)) ## Gameweek 29 ## # Hammarby 2 - Malmo 2 # HAM = cbind(HAM,c(2,2)) MAL = cbind(MAL,c(2,2)) # IF Elfsborg 1 - Vasteras 0 # ELF = cbind(ELF,c(1,0)) VSK = cbind(VSK,c(0,1)) # Goteborg 1 - Kalmar FF 1 # GOT = cbind(GOT,c(1,1)) KAL = cbind(KAL,c(1,1)) # IF Brommapojkarna 0 - Varnamo 1 # BRO = cbind(BRO,c(0,1)) IKV = cbind(IKV,c(1,0)) # Hacken 1 - GAIS 2 # HAC = cbind(HAC,c(1,2)) GAI = cbind(GAI,c(2,1)) # Halmstad 1 - Djurgarden 0 # HAL = cbind(HAL,c(1,0)) DJU = cbind(DJU,c(0,1)) # Sirius 1 - Mjallby 1 # SIR = cbind(SIR,c(1,1)) MJA = cbind(MJA,c(1,1)) # Norrkoping 1 - AIK 0 # NRK = cbind(NRK,c(1,0)) AIK = cbind(AIK,c(0,1)) ## Gameweek 30 ## # GAIS 2 - Sirius 1 # GAI = cbind(GAI,c(2,1)) SIR = cbind(SIR,c(1,2)) # Malmo 2 - IF Brommapojkarna 1 # MAL = cbind(MAL,c(2,1)) BRO = cbind(BRO,c(1,2)) # Vasteras 1 - Hammarby 0 # VSK = cbind(VSK,c(1,0)) HAM = cbind(HAM,c(0,1)) # Varnamo 0 - IF Elfsborg 0 # IKV = cbind(IKV,c(0,0)) ELF = cbind(ELF,c(0,0)) # Djurgarden 3 - Norrkoping 1 # DJU = cbind(DJU,c(3,1)) NRK = cbind(NRK,c(1,3)) # Mjallby 1 - Goteborg 0 # MJA = cbind(MJA,c(1,0)) GOT = cbind(GOT,c(0,1)) # Kalmar FF 1 - Hacken 0 # KAL = cbind(KAL,c(1,0)) HAC = cbind(HAC,c(0,1)) # AIK 5 - Halmstad 1 # AIK = cbind(AIK,c(5,1)) HAL = cbind(HAL,c(1,5)) ### 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