### 1. Create table ### col_head = c("Team","GP","W","D","L","GF","GA","GD","Pts") # Column headings teams = c("AKH","KLN","CSK","DMO","FAK","KRA","FCO","FCR", "FCU","KSS","LMO","NIZ","SCH","RKA","SPM","ZSP") # 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 ## # Dynamo Moscow 1 - Krasnodar 3 # DMO = matrix(c(1,3),nrow=2) KRA = matrix(c(3,1),nrow=2) # Ural 2 - CSKA Moscow 1 # FCU = matrix(c(2,1),nrow=2) CSK = matrix(c(1,2),nrow=2) # Nizhny Novgorod 0 - Zenit 2 # NIZ = matrix(c(0,2),nrow=2) ZSP = matrix(c(2,0),nrow=2) # Lokomotiv Moscow 2 - Rubin Kazan 2 # LMO = matrix(c(2,2),nrow=2) RKA = matrix(c(2,2),nrow=2) # Akhmat Grozny 1 - Krylya Sovetov 2 # AKH = matrix(c(1,2),nrow=2) KSS = matrix(c(2,1),nrow=2) # Spartak Moscow 3 - Orenburg 2 # SPM = matrix(c(3,2),nrow=2) FCO = matrix(c(2,3),nrow=2) # FC Rostov 2 - Fakel 1 # FCR = matrix(c(2,1),nrow=2) FAK = matrix(c(1,2),nrow=2) # PFC Sochi 2 - Baltika 0 # SCH = matrix(c(2,0),nrow=2) KLN = matrix(c(0,2),nrow=2) ## Gameweek 2 ## # Krylya Sovetov 3 - Dynamo Moscow 3 # KSS = cbind(KSS,c(3,3)) DMO = cbind(DMO,c(3,3)) # Ural 0 - Nizhny Novgorod 0 # FCU = cbind(FCU,c(0,0)) NIZ = cbind(NIZ,c(0,0)) # FC Rostov 1 - Zenit 1 # FCR = cbind(FCR,c(1,1)) ZSP = cbind(ZSP,c(1,1)) # Rubin Kazan 1 - Orenburg 1 # RKA = cbind(RKA,c(1,1)) FCO = cbind(FCO,c(1,1)) # Fakel 1 - Lokomotiv Moscow 4 # FAK = cbind(FAK,c(1,4)) LMO = cbind(LMO,c(4,1)) # Akhmat Grozny 2 - CSKA Moscow 3 # AKH = cbind(AKH,c(2,3)) CSK = cbind(CSK,c(3,2)) # Krasnodar 2 - PFC Sochi 0 # KRA = cbind(KRA,c(2,0)) SCH = cbind(SCH,c(0,2)) # Spartak Moscow 2 - Baltika 1 # SPM = cbind(SPM,c(2,1)) KLN = cbind(KLN,c(1,2)) ## Gameweek 3 ## # Krasnodar 1 - Nizhny Novgorod 0 # KRA = cbind(KRA,c(1,0)) NIZ = cbind(NIZ,c(0,1)) # Krylya Sovetov 5 - FC Rostov 1 # KSS = cbind(KSS,c(5,1)) FCR = cbind(FCR,c(1,5)) # Orenburg 0 - Ural 2 # FCO = cbind(FCO,c(0,2)) FCU = cbind(FCU,c(2,0)) # Rubin Kazan 1 - Spartak Moscow 4 # RKA = cbind(RKA,c(1,4)) SPM = cbind(SPM,c(4,1)) # CSKA Moscow 4 - Lokomotiv Moscow 1 # CSK = cbind(CSK,c(4,1)) LMO = cbind(LMO,c(1,4)) # Baltika 2 - Fakel 1 # KLN = cbind(KLN,c(2,1)) FAK = cbind(FAK,c(1,2)) # Zenit 2 - Dynamo Moscow 3 # ZSP = cbind(ZSP,c(2,3)) DMO = cbind(DMO,c(3,2)) # PFC Sochi 1 - Akhmat Grozny 2 # SCH = cbind(SCH,c(1,2)) AKH = cbind(AKH,c(2,1)) ## Gameweek 4 ## # Ural 3 - Spartak Moscow 2 # FCU = cbind(FCU,c(3,2)) SPM = cbind(SPM,c(2,3)) # Lokomotiv Moscow 1 - Krylya Sovetov 1 # LMO = cbind(LMO,c(1,1)) KSS = cbind(KSS,c(1,1)) # Orenburg 0 - Krasnodar 2 # FCO = cbind(FCO,c(0,2)) KRA = cbind(KRA,c(2,0)) # FC Rostov 3 - Rubin Kazan 0 # FCR = cbind(FCR,c(3,0)) RKA = cbind(RKA,c(0,3)) # Dynamo Moscow 2 - Baltika 0 # DMO = cbind(DMO,c(2,0)) KLN = cbind(KLN,c(0,2)) # Zenit 2 - Fakel 0 # ZSP = cbind(ZSP,c(2,0)) FAK = cbind(FAK,c(0,2)) # CSKA Moscow 3 - PFC Sochi 1 # CSK = cbind(CSK,c(3,1)) SCH = cbind(SCH,c(1,3)) # Nizhny Novgorod 2 - Akhmat Grozny 0 # NIZ = cbind(NIZ,c(2,0)) AKH = cbind(AKH,c(0,2)) ## Gameweek 5 ## # Rubin Kazan 2 - Krylya Sovetov 1 # RKA = cbind(RKA,c(2,1)) KSS = cbind(KSS,c(1,2)) # Dynamo Moscow 2 - CSKA Moscow 1 # DMO = cbind(DMO,c(2,1)) CSK = cbind(CSK,c(1,2)) # Baltika 0 - Ural 1 # KLN = cbind(KLN,c(0,1)) FCU = cbind(FCU,c(1,0)) # Krasnodar 1 - Lokomotiv Moscow 1 # KRA = cbind(KRA,c(1,1)) LMO = cbind(LMO,c(1,1)) # PFC Sochi 4 - FC Rostov 0 # SCH = cbind(SCH,c(4,0)) FCR = cbind(FCR,c(0,4)) # Fakel 2 - Nizhny Novgorod 0 # FAK = cbind(FAK,c(2,0)) NIZ = cbind(NIZ,c(0,2)) # Spartak Moscow 1 - Zenit 3 # SPM = cbind(SPM,c(1,3)) ZSP = cbind(ZSP,c(3,1)) # Akhmat Grozny 4 - Orenburg 0 # AKH = cbind(AKH,c(4,0)) FCO = cbind(FCO,c(0,4)) ## Gameweek 6 ## # Orenburg 1 - CSKA Moscow 1 # FCO = cbind(FCO,c(1,1)) CSK = cbind(CSK,c(1,1)) # Fakel 0 - Krasnodar 0 # FAK = cbind(FAK,c(0,0)) KRA = cbind(KRA,c(0,0)) # Zenit 4 - Ural 0 # ZSP = cbind(ZSP,c(4,0)) FCU = cbind(FCU,c(0,4)) # Rubin Kazan 2 - Dynamo Moscow 2 # RKA = cbind(RKA,c(2,2)) DMO = cbind(DMO,c(2,2)) # Spartak Moscow 0 - Akhmat Grozny 0 # SPM = cbind(SPM,c(0,0)) AKH = cbind(AKH,c(0,0)) # Nizhny Novgorod 1 - FC Rostov 0 # NIZ = cbind(NIZ,c(1,0)) FCR = cbind(FCR,c(0,1)) # Krylya Sovetov 2 - Baltika 1 # KSS = cbind(KSS,c(2,1)) KLN = cbind(KLN,c(1,2)) # PFC Sochi 0 - Lokomotiv Moscow 1 # SCH = cbind(SCH,c(0,1)) LMO = cbind(LMO,c(1,0)) ## Gameweek 7 ## # Ural 0 - Akhmat Grozny 1 # FCU = cbind(FCU,c(0,1)) AKH = cbind(AKH,c(1,0)) # Nizhny Novgorod 2 - Rubin Kazan 1 # NIZ = cbind(NIZ,c(2,1)) RKA = cbind(RKA,c(1,2)) # Krylya Sovetov 3 - Fakel 0 # KSS = cbind(KSS,c(3,0)) FAK = cbind(FAK,c(0,3)) # Krasnodar 2 - Spartak Moscow 0 # KRA = cbind(KRA,c(2,0)) SPM = cbind(SPM,c(0,2)) # Orenburg 3 - PFC Sochi 0 # FCO = cbind(FCO,c(3,0)) SCH = cbind(SCH,c(0,3)) # Lokomotiv Moscow 3 - Baltika 2 # LMO = cbind(LMO,c(3,2)) KLN = cbind(KLN,c(2,3)) # CSKA Moscow 1 - Zenit 1 # CSK = cbind(CSK,c(1,1)) ZSP = cbind(ZSP,c(1,1)) # FC Rostov 1 - Dynamo Moscow 2 # FCR = cbind(FCR,c(1,2)) DMO = cbind(DMO,c(2,1)) ## Gameweek 8 ## # Dynamo Moscow 1 - Nizhny Novgorod 1 # DMO = cbind(DMO,c(1,1)) NIZ = cbind(NIZ,c(1,1)) # CSKA Moscow 2 - Krylya Sovetov 2 # CSK = cbind(CSK,c(2,2)) KSS = cbind(KSS,c(2,2)) # Akhmat Grozny 1 - Krasnodar 1 # AKH = cbind(AKH,c(1,1)) KRA = cbind(KRA,c(1,1)) # Spartak Moscow 1 - PFC Sochi 0 # SPM = cbind(SPM,c(1,0)) SCH = cbind(SCH,c(0,1)) # Baltika 2 - FC Rostov 2 # KLN = cbind(KLN,c(2,2)) FCR = cbind(FCR,c(2,2)) # Ural 0 - Fakel 0 # FCU = cbind(FCU,c(0,0)) FAK = cbind(FAK,c(0,0)) # Rubin Kazan 0 - Zenit 3 # RKA = cbind(RKA,c(0,3)) ZSP = cbind(ZSP,c(3,0)) # Lokomotiv Moscow 0 - Orenburg 2 # LMO = cbind(LMO,c(0,2)) FCO = cbind(FCO,c(2,0)) ## Gameweek 9 ## # Krylya Sovetov 2 - PFC Sochi 1 # KSS = cbind(KSS,c(2,1)) SCH = cbind(SCH,c(1,2)) # Baltika 1 - Akhmat Grozny 0 # KLN = cbind(KLN,c(1,0)) AKH = cbind(AKH,c(0,1)) # Spartak Moscow 1 - Dynamo Moscow 0 # SPM = cbind(SPM,c(1,0)) DMO = cbind(DMO,c(0,1)) # Nizhny Novgorod 3 - Orenburg 1 # NIZ = cbind(NIZ,c(3,1)) FCO = cbind(FCO,c(1,3)) # Zenit 1 - Lokomotiv Moscow 2 # ZSP = cbind(ZSP,c(1,2)) LMO = cbind(LMO,c(2,1)) # Krasnodar 2 - Ural 0 # KRA = cbind(KRA,c(2,0)) FCU = cbind(FCU,c(0,2)) # FC Rostov 3 - CSKA Moscow 3 # FCR = cbind(FCR,c(3,3)) CSK = cbind(CSK,c(3,3)) # Fakel 0 - Rubin Kazan 1 # FAK = cbind(FAK,c(0,1)) RKA = cbind(RKA,c(1,0)) ## Gameweek 10 ## # FC Rostov 2 - Ural 2 # FCR = cbind(FCR,c(2,2)) FCU = cbind(FCU,c(2,2)) # Orenburg 3 - Zenit 1 # FCO = cbind(FCO,c(3,1)) ZSP = cbind(ZSP,c(1,3)) # Lokomotiv Moscow 1 - Nizhny Novgorod 0 # LMO = cbind(LMO,c(1,0)) NIZ = cbind(NIZ,c(0,1)) # Rubin Kazan 0 - Krasnodar 2 # RKA = cbind(RKA,c(0,2)) KRA = cbind(KRA,c(2,0)) # CSKA Moscow 1 - Baltika 0 # CSK = cbind(CSK,c(1,0)) KLN = cbind(KLN,c(0,1)) # Fakel 2 - PFC Sochi 0 # FAK = cbind(FAK,c(2,0)) SCH = cbind(SCH,c(0,2)) # Krylya Sovetov 4 - Spartak Moscow 0 # KSS = cbind(KSS,c(4,0)) SPM = cbind(SPM,c(0,4)) # Akhmat Grozny 1 - Dynamo Moscow 1 # AKH = cbind(AKH,c(1,1)) DMO = cbind(DMO,c(1,1)) ## Gameweek 11 ## # Ural 2 - Lokomotiv Moscow 2 # FCU = cbind(FCU,c(2,2)) LMO = cbind(LMO,c(2,2)) # PFC Sochi 0 - Zenit 2 # SCH = cbind(SCH,c(0,2)) ZSP = cbind(ZSP,c(2,0)) # Baltika 1 - Orenburg 0 # KLN = cbind(KLN,c(1,0)) FCO = cbind(FCO,c(0,1)) # Krasnodar 3 - FC Rostov 2 # KRA = cbind(KRA,c(3,2)) FCR = cbind(FCR,c(2,3)) # Nizhny Novgorod 2 - Krylya Sovetov 0 # NIZ = cbind(NIZ,c(2,0)) KSS = cbind(KSS,c(0,2)) # Dynamo Moscow 0 - Fakel 0 # DMO = cbind(DMO,c(0,0)) FAK = cbind(FAK,c(0,0)) # Spartak Moscow 2 - CSKA Moscow 2 # SPM = cbind(SPM,c(2,2)) CSK = cbind(CSK,c(2,2)) # Akhmat Grozny 0 - Rubin Kazan 1 # AKH = cbind(AKH,c(0,1)) RKA = cbind(RKA,c(1,0)) ## Gameweek 12 ## # Orenburg 1 - Fakel 2 # FCO = cbind(FCO,c(1,2)) FAK = cbind(FAK,c(2,1)) # Rubin Kazan 0 - CSKA Moscow 0 # RKA = cbind(RKA,c(0,0)) CSK = cbind(CSK,c(0,0)) # Lokomotiv Moscow 0 - Dynamo Moscow 0 # LMO = cbind(LMO,c(0,0)) DMO = cbind(DMO,c(0,0)) # Baltika 2 - Krasnodar 2 # KLN = cbind(KLN,c(2,2)) KRA = cbind(KRA,c(2,2)) # Ural 1 - PFC Sochi 4 # FCU = cbind(FCU,c(1,4)) SCH = cbind(SCH,c(4,1)) # Spartak Moscow 2 - Nizhny Novgorod 0 # SPM = cbind(SPM,c(2,0)) NIZ = cbind(NIZ,c(0,2)) # Zenit 3 - Krylya Sovetov 1 # ZSP = cbind(ZSP,c(3,1)) KSS = cbind(KSS,c(1,3)) # FC Rostov 3 - Akhmat Grozny 0 # FCR = cbind(FCR,c(3,0)) AKH = cbind(AKH,c(0,3)) ## Gameweek 13 ## # Rubin Kazan 1 - Baltika 0 # RKA = cbind(RKA,c(1,0)) KLN = cbind(KLN,c(0,1)) # Fakel 2 - Spartak Moscow 0 # FAK = cbind(FAK,c(2,0)) SPM = cbind(SPM,c(0,2)) # FC Rostov 1 - Lokomotiv Moscow 0 # FCR = cbind(FCR,c(1,0)) LMO = cbind(LMO,c(0,1)) # Krylya Sovetov 1 - Orenburg 1 # KSS = cbind(KSS,c(1,1)) FCO = cbind(FCO,c(1,1)) # Zenit 2 - Akhmat Grozny 1 # ZSP = cbind(ZSP,c(2,1)) AKH = cbind(AKH,c(1,2)) # Nizhny Novgorod 1 - PFC Sochi 0 # NIZ = cbind(NIZ,c(1,0)) SCH = cbind(SCH,c(0,1)) # Dynamo Moscow 2 - Ural 1 # DMO = cbind(DMO,c(2,1)) FCU = cbind(FCU,c(1,2)) # CSKA Moscow 1 - Krasnodar 0 # CSK = cbind(CSK,c(1,0)) KRA = cbind(KRA,c(0,1)) ## Gameweek 14 ## # Akhmat Grozny 1 - Fakel 2 # AKH = cbind(AKH,c(1,2)) FAK = cbind(FAK,c(2,1)) # Baltika 0 - Zenit 2 # KLN = cbind(KLN,c(0,2)) ZSP = cbind(ZSP,c(2,0)) # Krasnodar 2 - Krylya Sovetov 1 # KRA = cbind(KRA,c(2,1)) KSS = cbind(KSS,c(1,2)) # CSKA Moscow 3 - Nizhny Novgorod 2 # CSK = cbind(CSK,c(3,2)) NIZ = cbind(NIZ,c(2,3)) # Lokomotiv Moscow 1 - Spartak Moscow 1 # LMO = cbind(LMO,c(1,1)) SPM = cbind(SPM,c(1,1)) # Orenburg 1 - FC Rostov 1 # FCO = cbind(FCO,c(1,1)) FCR = cbind(FCR,c(1,1)) # Ural 0 - Rubin Kazan 1 # FCU = cbind(FCU,c(0,1)) RKA = cbind(RKA,c(1,0)) # PFC Sochi 3 - Dynamo Moscow 3 # SCH = cbind(SCH,c(3,3)) DMO = cbind(DMO,c(3,3)) ## Gameweek 15 ## # Krylya Sovetov 3 - Ural 1 # KSS = cbind(KSS,c(3,1)) FCU = cbind(FCU,c(1,3)) # Fakel 1 - CSKA Moscow 1 # FAK = cbind(FAK,c(1,1)) CSK = cbind(CSK,c(1,1)) # Lokomotiv Moscow 2 - Akhmat Grozny 1 # LMO = cbind(LMO,c(2,1)) AKH = cbind(AKH,c(1,2)) # Zenit 1 - Krasnodar 1 # ZSP = cbind(ZSP,c(1,1)) KRA = cbind(KRA,c(1,1)) # Nizhny Novgorod 0 - Baltika 0 # NIZ = cbind(NIZ,c(0,0)) KLN = cbind(KLN,c(0,0)) # Dynamo Moscow 2 - Orenburg 0 # DMO = cbind(DMO,c(2,0)) FCO = cbind(FCO,c(0,2)) # PFC Sochi 0 - Rubin Kazan 2 # SCH = cbind(SCH,c(0,2)) RKA = cbind(RKA,c(2,0)) # Spartak Moscow 2 - FC Rostov 1 # SPM = cbind(SPM,c(2,1)) FCR = cbind(FCR,c(1,2)) ## Gameweek 16 ## # Krylya Sovetov 3 - Lokomotiv Moscow 3 # KSS = cbind(KSS,c(3,3)) LMO = cbind(LMO,c(3,3)) # Zenit 3 - PFC Sochi 0 # ZSP = cbind(ZSP,c(3,0)) SCH = cbind(SCH,c(0,3)) # CSKA Moscow 2 - Dynamo Moscow 3 # CSK = cbind(CSK,c(2,3)) DMO = cbind(DMO,c(3,2)) # Baltika 0 - Spartak Moscow 2 # KLN = cbind(KLN,c(0,2)) SPM = cbind(SPM,c(2,0)) # Orenburg 1 - Akhmat Grozny 1 # FCO = cbind(FCO,c(1,1)) AKH = cbind(AKH,c(1,1)) # Ural 3 - Krasnodar 1 # FCU = cbind(FCU,c(3,1)) KRA = cbind(KRA,c(1,3)) # Rubin Kazan 1 - Fakel 0 # RKA = cbind(RKA,c(1,0)) FAK = cbind(FAK,c(0,1)) # FC Rostov 1 - Nizhny Novgorod 0 # FCR = cbind(FCR,c(1,0)) NIZ = cbind(NIZ,c(0,1)) ## Gameweek 17 ## # Fakel 0 - Baltika 0 # FAK = cbind(FAK,c(0,0)) KLN = cbind(KLN,c(0,0)) # PFC Sochi 0 - Krylya Sovetov 2 # SCH = cbind(SCH,c(0,2)) KSS = cbind(KSS,c(2,0)) # Nizhny Novgorod 1 - Ural 0 # NIZ = cbind(NIZ,c(1,0)) FCU = cbind(FCU,c(0,1)) # CSKA Moscow 2 - FC Rostov 0 # CSK = cbind(CSK,c(2,0)) FCR = cbind(FCR,c(0,2)) # Krasnodar 2 - Orenburg 1 # KRA = cbind(KRA,c(2,1)) FCO = cbind(FCO,c(1,2)) # Lokomotiv Moscow 3 - Zenit 1 # LMO = cbind(LMO,c(3,1)) ZSP = cbind(ZSP,c(1,3)) # Akhmat Grozny 2 - Spartak Moscow 1 # AKH = cbind(AKH,c(2,1)) SPM = cbind(SPM,c(1,2)) # Dynamo Moscow 1 - Rubin Kazan 0 # DMO = cbind(DMO,c(1,0)) RKA = cbind(RKA,c(0,1)) ## Gameweek 18 ## # Lokomotiv Moscow 2 - Ural 0 # LMO = cbind(LMO,c(2,0)) FCU = cbind(FCU,c(0,2)) # Spartak Moscow 3 - Krylya Sovetov 0 # SPM = cbind(SPM,c(3,0)) KSS = cbind(KSS,c(0,3)) # Akhmat Grozny 0 - FC Rostov 0 # AKH = cbind(AKH,c(0,0)) FCR = cbind(FCR,c(0,0)) # Zenit 1 - Nizhny Novgorod 0 # ZSP = cbind(ZSP,c(1,0)) NIZ = cbind(NIZ,c(0,1)) # Fakel 1 - Dynamo Moscow 1 # FAK = cbind(FAK,c(1,1)) DMO = cbind(DMO,c(1,1)) # PFC Sochi 1 - Orenburg 1 # SCH = cbind(SCH,c(1,1)) FCO = cbind(FCO,c(1,1)) # Baltika 0 - Rubin Kazan 1 # KLN = cbind(KLN,c(0,1)) RKA = cbind(RKA,c(1,0)) # Krasnodar 1 - CSKA Moscow 0 # KRA = cbind(KRA,c(1,0)) CSK = cbind(CSK,c(0,1)) ## Gameweek 19 ## # FC Rostov 2 - Krylya Sovetov 0 # FCR = cbind(FCR,c(2,0)) KSS = cbind(KSS,c(0,2)) # CSKA Moscow 1 - Orenburg 1 # CSK = cbind(CSK,c(1,1)) FCO = cbind(FCO,c(1,1)) # Krasnodar 1 - Rubin Kazan 1 # KRA = cbind(KRA,c(1,1)) RKA = cbind(RKA,c(1,1)) # Akhmat Grozny 1 - Ural 0 # AKH = cbind(AKH,c(1,0)) FCU = cbind(FCU,c(0,1)) # Zenit 0 - Spartak Moscow 0 # ZSP = cbind(ZSP,c(0,0)) SPM = cbind(SPM,c(0,0)) # Nizhny Novgorod 1 - Fakel 1 # NIZ = cbind(NIZ,c(1,1)) FAK = cbind(FAK,c(1,1)) # Dynamo Moscow 2 - Lokomotiv Moscow 1 # DMO = cbind(DMO,c(2,1)) LMO = cbind(LMO,c(1,2)) # Baltika 0 - PFC Sochi 0 # KLN = cbind(KLN,c(0,0)) SCH = cbind(SCH,c(0,0)) ## Gameweek 20 ## # Krylya Sovetov 0 - CSKA Moscow 2 # KSS = cbind(KSS,c(0,2)) CSK = cbind(CSK,c(2,0)) # FC Rostov 2 - Krasnodar 1 # FCR = cbind(FCR,c(2,1)) KRA = cbind(KRA,c(1,2)) # Ural 1 - Zenit 4 # FCU = cbind(FCU,c(1,4)) ZSP = cbind(ZSP,c(4,1)) # Rubin Kazan 0 - Nizhny Novgorod 1 # RKA = cbind(RKA,c(0,1)) NIZ = cbind(NIZ,c(1,0)) # Dynamo Moscow 2 - Akhmat Grozny 0 # DMO = cbind(DMO,c(2,0)) AKH = cbind(AKH,c(0,2)) # Orenburg 1 - Baltika 0 # FCO = cbind(FCO,c(1,0)) KLN = cbind(KLN,c(0,1)) # Lokomotiv Moscow 2 - PFC Sochi 2 # LMO = cbind(LMO,c(2,2)) SCH = cbind(SCH,c(2,2)) # Spartak Moscow 0 - Fakel 2 # SPM = cbind(SPM,c(0,2)) FAK = cbind(FAK,c(2,0)) ## Gameweek 21 ## # Dynamo Moscow 1 - FC Rostov 4 # DMO = cbind(DMO,c(1,4)) FCR = cbind(FCR,c(4,1)) # Krylya Sovetov 1 - Zenit 1 # KSS = cbind(KSS,c(1,1)) ZSP = cbind(ZSP,c(1,1)) # PFC Sochi 2 - CSKA Moscow 2 # SCH = cbind(SCH,c(2,2)) CSK = cbind(CSK,c(2,2)) # Baltika 2 - Nizhny Novgorod 0 # KLN = cbind(KLN,c(2,0)) NIZ = cbind(NIZ,c(0,2)) # Spartak Moscow 0 - Ural 0 # SPM = cbind(SPM,c(0,0)) FCU = cbind(FCU,c(0,0)) # Fakel 0 - Orenburg 0 # FAK = cbind(FAK,c(0,0)) FCO = cbind(FCO,c(0,0)) # Rubin Kazan 2 - Akhmat Grozny 1 # RKA = cbind(RKA,c(2,1)) AKH = cbind(AKH,c(1,2)) # Lokomotiv Moscow 1 - Krasnodar 1 # LMO = cbind(LMO,c(1,1)) KRA = cbind(KRA,c(1,1)) ## Gameweek 22 ## # Ural 1 - Krylya Sovetov 2 # FCU = cbind(FCU,c(1,2)) KSS = cbind(KSS,c(2,1)) # Nizhny Novgorod 3 - Krasnodar 4 # NIZ = cbind(NIZ,c(3,4)) KRA = cbind(KRA,c(4,3)) # FC Rostov 2 - PFC Sochi 2 # FCR = cbind(FCR,c(2,2)) SCH = cbind(SCH,c(2,2)) # CSKA Moscow 4 - Fakel 1 # CSK = cbind(CSK,c(4,1)) FAK = cbind(FAK,c(1,4)) # Zenit 1 - Baltika 0 # ZSP = cbind(ZSP,c(1,0)) KLN = cbind(KLN,c(0,1)) # Akhmat Grozny 0 - Lokomotiv Moscow 2 # AKH = cbind(AKH,c(0,2)) LMO = cbind(LMO,c(2,0)) # Dynamo Moscow 1 - Spartak Moscow 2 # DMO = cbind(DMO,c(1,2)) SPM = cbind(SPM,c(2,1)) # Orenburg 3 - Rubin Kazan 0 # FCO = cbind(FCO,c(3,0)) RKA = cbind(RKA,c(0,3)) ## Gameweek 23 ## # PFC Sochi 1 - Spartak Moscow 0 # SCH = cbind(SCH,c(1,0)) SPM = cbind(SPM,c(0,1)) # Akhmat Grozny 1 - Baltika 7 # AKH = cbind(AKH,c(1,7)) KLN = cbind(KLN,c(7,1)) # Krasnodar 1 - Zenit 2 # KRA = cbind(KRA,c(1,2)) ZSP = cbind(ZSP,c(2,1)) # Lokomotiv Moscow 3 - CSKA Moscow 3 # LMO = cbind(LMO,c(3,3)) CSK = cbind(CSK,c(3,3)) # Orenburg 3 - Nizhny Novgorod 1 # FCO = cbind(FCO,c(3,1)) NIZ = cbind(NIZ,c(1,3)) # Ural 2 - Dynamo Moscow 1 # FCU = cbind(FCU,c(2,1)) DMO = cbind(DMO,c(1,2)) # Fakel 0 - FC Rostov 1 # FAK = cbind(FAK,c(0,1)) FCR = cbind(FCR,c(1,0)) # Krylya Sovetov 2 - Rubin Kazan 0 # KSS = cbind(KSS,c(2,0)) RKA = cbind(RKA,c(0,2)) ## Gameweek 24 ## # Krasnodar 2 - Fakel 0 # KRA = cbind(KRA,c(2,0)) FAK = cbind(FAK,c(0,2)) # Rubin Kazan 1 - Lokomotiv Moscow 1 # RKA = cbind(RKA,c(1,1)) LMO = cbind(LMO,c(1,1)) # Baltika 2 - Krylya Sovetov 1 # KLN = cbind(KLN,c(2,1)) KSS = cbind(KSS,c(1,2)) # CSKA Moscow 1 - Akhmat Grozny 2 # CSK = cbind(CSK,c(1,2)) AKH = cbind(AKH,c(2,1)) # Nizhny Novgorod 1 - Dynamo Moscow 4 # NIZ = cbind(NIZ,c(1,4)) DMO = cbind(DMO,c(4,1)) # Zenit 1 - Orenburg 0 # ZSP = cbind(ZSP,c(1,0)) FCO = cbind(FCO,c(0,1)) # PFC Sochi 2 - Ural 2 # SCH = cbind(SCH,c(2,2)) FCU = cbind(FCU,c(2,2)) # FC Rostov 1 - Spartak Moscow 5 # FCR = cbind(FCR,c(1,5)) SPM = cbind(SPM,c(5,1)) ## Gameweek 25 ## # Orenburg 1 - Dynamo Moscow 2 # FCO = cbind(FCO,c(1,2)) DMO = cbind(DMO,c(2,1)) # Nizhny Novgorod 2 - Lokomotiv Moscow 3 # NIZ = cbind(NIZ,c(2,3)) LMO = cbind(LMO,c(3,2)) # Zenit 0 - Rubin Kazan 2 # ZSP = cbind(ZSP,c(0,2)) RKA = cbind(RKA,c(2,0)) # Krasnodar 3 - Baltika 2 # KRA = cbind(KRA,c(3,2)) KLN = cbind(KLN,c(2,3)) # Ural 0 - FC Rostov 1 # FCU = cbind(FCU,c(0,1)) FCR = cbind(FCR,c(1,0)) # Fakel 0 - Krylya Sovetov 1 # FAK = cbind(FAK,c(0,1)) KSS = cbind(KSS,c(1,0)) # CSKA Moscow 0 - Spartak Moscow 0 # CSK = cbind(CSK,c(0,0)) SPM = cbind(SPM,c(0,0)) # Akhmat Grozny 1 - PFC Sochi 0 # AKH = cbind(AKH,c(1,0)) SCH = cbind(SCH,c(0,1)) ## Gameweek 26 ## # Akhmat Grozny 5 - Nizhny Novgorod 1 # AKH = cbind(AKH,c(5,1)) NIZ = cbind(NIZ,c(1,5)) # Spartak Moscow 3 - Lokomotiv Moscow 2 # SPM = cbind(SPM,c(3,2)) LMO = cbind(LMO,c(2,3)) # Dynamo Moscow 1 - Zenit 0 # DMO = cbind(DMO,c(1,0)) ZSP = cbind(ZSP,c(0,1)) # Baltika 3 - CSKA Moscow 1 # KLN = cbind(KLN,c(3,1)) CSK = cbind(CSK,c(1,3)) # Krylya Sovetov 0 - Krasnodar 0 # KSS = cbind(KSS,c(0,0)) KRA = cbind(KRA,c(0,0)) # Rubin Kazan 1 - Ural 1 # RKA = cbind(RKA,c(1,1)) FCU = cbind(FCU,c(1,1)) # PFC Sochi 0 - Fakel 0 # SCH = cbind(SCH,c(0,0)) FAK = cbind(FAK,c(0,0)) # FC Rostov 2 - Orenburg 1 # FCR = cbind(FCR,c(2,1)) FCO = cbind(FCO,c(1,2)) ## Gameweek 27 ## # Orenburg 2 - Krylya Sovetov 1 # FCO = cbind(FCO,c(2,1)) KSS = cbind(KSS,c(1,2)) # Krasnodar 0 - Akhmat Grozny 1 # KRA = cbind(KRA,c(0,1)) AKH = cbind(AKH,c(1,0)) # Dynamo Moscow 3 - PFC Sochi 2 # DMO = cbind(DMO,c(3,2)) SCH = cbind(SCH,c(2,3)) # Nizhny Novgorod 0 - Spartak Moscow 0 # NIZ = cbind(NIZ,c(0,0)) SPM = cbind(SPM,c(0,0)) # Ural 2 - Baltika 1 # FCU = cbind(FCU,c(2,1)) KLN = cbind(KLN,c(1,2)) # Fakel 1 - Zenit 1 # FAK = cbind(FAK,c(1,1)) ZSP = cbind(ZSP,c(1,1)) # CSKA Moscow 2 - Rubin Kazan 2 # CSK = cbind(CSK,c(2,2)) RKA = cbind(RKA,c(2,2)) # Lokomotiv Moscow 1 - FC Rostov 0 # LMO = cbind(LMO,c(1,0)) FCR = cbind(FCR,c(0,1)) ## Gameweek 28 ## # Krylya Sovetov 0 - Akhmat Grozny 2 # KSS = cbind(KSS,c(0,2)) AKH = cbind(AKH,c(2,0)) # Rubin Kazan 3 - FC Rostov 1 # RKA = cbind(RKA,c(3,1)) FCR = cbind(FCR,c(1,3)) # Spartak Moscow 1 - Krasnodar 0 # SPM = cbind(SPM,c(1,0)) KRA = cbind(KRA,c(0,1)) # Zenit 0 - CSKA Moscow 1 # ZSP = cbind(ZSP,c(0,1)) CSK = cbind(CSK,c(1,0)) # Baltika 2 - Dynamo Moscow 3 # KLN = cbind(KLN,c(2,3)) DMO = cbind(DMO,c(3,2)) # Orenburg 0 - Lokomotiv Moscow 2 # FCO = cbind(FCO,c(0,2)) LMO = cbind(LMO,c(2,0)) # Fakel 0 - Ural 0 # FAK = cbind(FAK,c(0,0)) FCU = cbind(FCU,c(0,0)) # PFC Sochi 6 - Nizhny Novgorod 1 # SCH = cbind(SCH,c(6,1)) NIZ = cbind(NIZ,c(1,6)) ## Gameweek 29 ## # Dynamo Moscow 4 - Krylya Sovetov 1 # DMO = cbind(DMO,c(4,1)) KSS = cbind(KSS,c(1,4)) # Lokomotiv Moscow 2 - Fakel 0 # LMO = cbind(LMO,c(2,0)) FAK = cbind(FAK,c(0,2)) # PFC Sochi 2 - Krasnodar 3 # SCH = cbind(SCH,c(2,3)) KRA = cbind(KRA,c(3,2)) # Ural 3 - Orenburg 3 # FCU = cbind(FCU,c(3,3)) FCO = cbind(FCO,c(3,3)) # Spartak Moscow 3 - Rubin Kazan 1 # SPM = cbind(SPM,c(3,1)) RKA = cbind(RKA,c(1,3)) # FC Rostov 2 - Baltika 1 # FCR = cbind(FCR,c(2,1)) KLN = cbind(KLN,c(1,2)) # Akhmat Grozny 1 - Zenit 5 # AKH = cbind(AKH,c(1,5)) ZSP = cbind(ZSP,c(5,1)) # Nizhny Novgorod 2 - CSKA Moscow 6 # NIZ = cbind(NIZ,c(2,6)) CSK = cbind(CSK,c(6,2)) ## Gameweek 30 ## # Baltika 1 - Lokomotiv Moscow 3 # KLN = cbind(KLN,c(1,3)) LMO = cbind(LMO,c(3,1)) # Fakel 2 - Akhmat Grozny 0 # FAK = cbind(FAK,c(2,0)) AKH = cbind(AKH,c(0,2)) # Orenburg 0 - Spartak Moscow 0 # FCO = cbind(FCO,c(0,0)) SPM = cbind(SPM,c(0,0)) # Krasnodar 1 - Dynamo Moscow 0 # KRA = cbind(KRA,c(1,0)) DMO = cbind(DMO,c(0,1)) # Zenit 2 - FC Rostov 1 # ZSP = cbind(ZSP,c(2,1)) FCR = cbind(FCR,c(1,2)) # Krylya Sovetov 1 - Nizhny Novgorod 1 # KSS = cbind(KSS,c(1,1)) NIZ = cbind(NIZ,c(1,1)) # Rubin Kazan 1 - PFC Sochi 1 # RKA = cbind(RKA,c(1,1)) SCH = cbind(SCH,c(1,1)) # CSKA 2 - Ural 0 # CSK = cbind(CSK,c(2,0)) FCU = cbind(FCU,c(0,2)) ### 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