R:返回的子集为空

时间:2017-11-21 16:07:28

标签: r for-loop dataframe subset

我遇到了问题,因为如果我从循环中创建一个子集,那么这个子集就有数据。例如:

localGames <- subset(games, id_club_home == 1)

子集有数据

enter image description here

但是,如果我在一个循环中做同样的事情,那么我的子集就是空的。这是我的代码:

for (j in 1:nrow(teams)){
  row <- teams[j,]
  print(paste(c("idTeam: ", row["idTeam"]), collapse = ""))
  homeGames <- subset(games, id_club_home == row["idTeam"])
  print(paste(c("Length: ", length(homeGames)), collapse = " "))
  print(paste(c("Total rows: ", nrow(homeGames)), collapse = " "))
}

我总是有0行,除了idTeam = 10.但是当idTeam = 10时总行数不正确。

[1] "idTeam: 1"
[1] "Length:  10"
[1] "Total rows:  0"
[1] "idTeam: 2"
[1] "Length:  10"
[1] "Total rows:  0"
[1] "idTeam: 3"
[1] "Length:  10"
[1] "Total rows:  0"
[1] "idTeam: 4"
[1] "Length:  10"
[1] "Total rows:  0"
[1] "idTeam: 5"
[1] "Length:  10"
[1] "Total rows:  0"
[1] "idTeam: 6"
[1] "Length:  10"
[1] "Total rows:  0"
[1] "idTeam: 7"
[1] "Length:  10"
[1] "Total rows:  0"
[1] "idTeam: 8"
[1] "Length:  10"
[1] "Total rows:  0"
[1] "idTeam: 9"
[1] "Length:  10"
[1] "Total rows:  0"
[1] "idTeam: 10"
[1] "Length:  10"
[1] "Total rows:  57"
[1] "idTeam: 11"
[1] "Length:  10"
[1] "Total rows:  0"
[1] "idTeam: 12"
[1] "Length:  10"
[1] "Total rows:  0"
[1] "idTeam: 13"
[1] "Length:  10"
[1] "Total rows:  0"
[1] "idTeam: 14"
[1] "Length:  10"
[1] "Total rows:  0"

idTeam = id_club_home = 10的总行数是5而不是57,就像我看到的那样:

enter image description here

我们在所有idTeam的homeGames中都有数据。

为什么我得到这个结果而不是正确的结果?

编辑I:

以下是我从数据库中检索的所有数据

structure(list(idTeam = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 
12, 13, 14), teamName = c("NISSAN AL-Q\xc1ZERES EXTREMADURA", 
"CADI LA SEU", "CAMPUS PROMETE LF1", "EMBUTIDOS PAJARIEL BEMBIBRE PDM", 
"IDK GIPUZKOA", "LACTURALE ART ARASKI", "LOINTEK GERNIKA BIZKAIA", 
"MANN-FILTER", "MOVISTAR ESTUDIANTES", "PERFUMERIAS AVENIDA", 
"QUESOS EL PASTOR", "SNATT'S FEMENI SANT ADRIA", "SPAR CITYLIFT GIRONA", 
"STAR CENTER-UNI FERROL")), .Names = c("idTeam", "teamName"), row.names = c(NA, 
-14L), class = "data.frame")

> dput(teams)
structure(list(idTeam = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 
12, 13, 14), teamName = c("NISSAN AL-Q\xc1ZERES EXTREMADURA", 
"CADI LA SEU", "CAMPUS PROMETE LF1", "EMBUTIDOS PAJARIEL BEMBIBRE PDM", 
"IDK GIPUZKOA", "LACTURALE ART ARASKI", "LOINTEK GERNIKA BIZKAIA", 
"MANN-FILTER", "MOVISTAR ESTUDIANTES", "PERFUMERIAS AVENIDA", 
"QUESOS EL PASTOR", "SNATT'S FEMENI SANT ADRIA", "SPAR CITYLIFT GIRONA", 
"STAR CENTER-UNI FERROL")), .Names = c("idTeam", "teamName"), row.names = c(NA, 
-14L), class = "data.frame")
> dput(games)
structure(list(id = c(2, 3, 4, 5, 6, 7, 8, 23, 24, 25, 26, 27, 
28, 29, 30, 31, 32, 33, 34, 35, 36, 51, 52, 53, 54, 55, 56, 57, 
72, 73, 74, 75, 76, 77, 78, 93, 94, 95, 96, 97, 98, 99, 135, 
136, 137, 138, 139, 140, 141, 169, 170, 171, 172, 173, 174, 175, 
1), id_jornada = c(2, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 6, 
7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10, 10, 10, 13, 13, 13, 
13, 13, 13, 13, 16, 16, 16, 16, 16, 16, 16, 19, 19, 19, 19, 19, 
19, 19, 24, 24, 24, 24, 24, 24, 24, 1), id_club_home = c(10, 
13, 7, 3, 14, 6, 5, 1, 2, 12, 7, 8, 4, 9, 10, 14, 6, 7, 5, 3, 
1, 2, 12, 11, 8, 4, 9, 13, 10, 6, 7, 5, 3, 1, 2, 12, 11, 8, 4, 
9, 13, 14, 10, 7, 5, 3, 1, 2, 12, 11, 8, 4, 9, 13, 14, 6, 10), 
    id_club_visitor = c(9, 4, 12, 1, 8, 11, 2, 10, 3, 5, 11, 
    6, 14, 13, 13, 9, 4, 8, 11, 12, 2, 10, 1, 3, 5, 7, 6, 14, 
    14, 13, 9, 4, 8, 11, 12, 10, 2, 1, 3, 5, 7, 6, 6, 14, 13, 
    9, 4, 8, 11, 10, 12, 2, 1, 3, 5, 7, 13), home_score = c(82, 
    71, 73, 55, 90, 63, 72, 52, 79, 59, 78, 79, 56, 71, 76, 73, 
    72, 68, 64, 80, 68, 48, 67, 80, 68, 77, 59, 72, 50, 53, 101, 
    58, 67, 83, 62, 48, 66, 72, 74, 57, 80, 78, 69, 89, 72, 68, 
    72, 59, 83, 50, 69, 85, 75, 74, 71, 73, 61), visitor_score = c(58, 
    53, 80, 83, 81, 54, 68, 83, 53, 64, 58, 55, 66, 84, 53, 63, 
    63, 75, 40, 81, 79, 64, 79, 73, 73, 78, 73, 54, 54, 88, 51, 
    64, 86, 72, 69, 91, 74, 59, 53, 68, 70, 74, 54, 82, 66, 62, 
    59, 76, 60, 88, 75, 79, 87, 52, 61, 62, 55), place = c("ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", "ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", "ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", "ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "PAB. MUNIC. \"JUAN SERRANO MACAYO\", C\xe1ceres (C\xe1ceres)", 
    "PALAU MUNICIPAL D\xb4ESPORTS, Seu d'Urgell, La (Lleida)", 
    "PABELLON MUNICIPAL MARINA BESOS, Sant Adri\xe0 de Bes\xf2s (Barcelona)", 
    "POL. MALOSTE, Gernika-Lumo (Vizcaya)", "PAB.POLDVO. EDUARDO LASTRADA (STADIUM CASABLANCA), Zaragoza (Zaragoza)", 
    "PABELLON BEMBIBRE ARENA, Bembibre (Le\xf3n)", "1018-ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "PABELLON MUNICIPAL WURZBURG, Salamanca (Salamanca)", "PAV. MUNICIPAL  ESTEIRO, Ferrol (A Coru\xf1a)", 
    "POLIDEPORTIVO MENDIZORROTZA, Vitoria-Gasteiz (\xc1lava)", 
    "POL. MALOSTE, Gernika-Lumo (Vizcaya)", "POL. JOSE ANTONIO GASCA, Donostia-San Sebasti\xe1n (Guip\xfazcoa)", 
    "Palacio de los Deportes de La Rioja, Logro\xf1o (La Rioja)", 
    "PAB. MUNIC. \"JUAN SERRANO MACAYO\", C\xe1ceres (C\xe1ceres)", 
    "PALAU MUNICIPAL D\xb4ESPORTS, Seu d'Urgell, La (Lleida)", 
    "PABELLON MUNICIPAL MARINA BESOS, Sant Adri\xe0 de Bes\xf2s (Barcelona)", 
    "PABELLON MUNICIPAL ANGEL NIETO, Zamora (Zamora)", "PAB.POLDVO. EDUARDO LASTRADA (STADIUM CASABLANCA), Zaragoza (Zaragoza)", 
    "PABELLON BEMBIBRE ARENA, Bembibre (Le\xf3n)", "1018-ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "PAVELL\xd3N MUNICIPAL GIRONA FONTAJAU, Girona (Girona)", 
    "PABELLON MUNICIPAL WURZBURG, Salamanca (Salamanca)", "POLIDEPORTIVO MENDIZORROTZA, Vitoria-Gasteiz (\xc1lava)", 
    "POL. MALOSTE, Gernika-Lumo (Vizcaya)", "POL. JOSE ANTONIO GASCA, Donostia-San Sebasti\xe1n (Guip\xfazcoa)", 
    "Palacio de los Deportes de La Rioja, Logro\xf1o (La Rioja)", 
    "PAB. MUNIC. \"JUAN SERRANO MACAYO\", C\xe1ceres (C\xe1ceres)", 
    "PALAU MUNICIPAL D\xb4ESPORTS, Seu d'Urgell, La (Lleida)", 
    "PABELLON MUNICIPAL MARINA BESOS, Sant Adri\xe0 de Bes\xf2s (Barcelona)", 
    "PABELLON MUNICIPAL ANGEL NIETO, Zamora (Zamora)", "PAB.POLDVO. EDUARDO LASTRADA (STADIUM CASABLANCA), Zaragoza (Zaragoza)", 
    "PABELLON BEMBIBRE ARENA, Bembibre (Le\xf3n)", "1018-ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "PAVELL\xd3N MUNICIPAL GIRONA FONTAJAU, Girona (Girona)", 
    "PAV. MUNICIPAL  ESTEIRO, Ferrol (A Coru\xf1a)", "PABELLON MUNICIPAL WURZBURG, Salamanca (Salamanca)", 
    "POL. MALOSTE, Gernika-Lumo (Vizcaya)", "POL. JOSE ANTONIO GASCA, Donostia-San Sebasti\xe1n (Guip\xfazcoa)", 
    "Palacio de los Deportes de La Rioja, Logro\xf1o (La Rioja)", 
    "PAB. MUNIC. \"JUAN SERRANO MACAYO\", C\xe1ceres (C\xe1ceres)", 
    "PALAU MUNICIPAL D\xb4ESPORTS, Seu d'Urgell, La (Lleida)", 
    "PABELLON MUNICIPAL MARINA BESOS, Sant Adri\xe0 de Bes\xf2s (Barcelona)", 
    "PABELLON MUNICIPAL ANGEL NIETO, Zamora (Zamora)", "PAB.POLDVO. EDUARDO LASTRADA (STADIUM CASABLANCA), Zaragoza (Zaragoza)", 
    "PABELLON BEMBIBRE ARENA, Bembibre (Le\xf3n)", "1018-ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "PAVELL\xd3N MUNICIPAL GIRONA FONTAJAU, Girona (Girona)", 
    "PAV. MUNICIPAL  ESTEIRO, Ferrol (A Coru\xf1a)", "POLIDEPORTIVO MENDIZORROTZA, Vitoria-Gasteiz (\xc1lava)", 
    "PABELLON MUNICIPAL WURZBURG, Salamanca (Salamanca)"), fecha = c("2017-09-30 18:00:00", 
    "2017-09-30 13:15:00", "2017-09-30 20:15:00", "2017-09-30 11:00:00", 
    "2017-10-01 16:00:00", "2017-10-01 10:00:00", "2017-10-01 12:15:00", 
    "2017-10-04 20:30:00", "2017-10-04 21:00:00", "2017-10-04 20:30:00", 
    "2017-10-04 20:00:00", "2017-10-04 19:00:00", "2017-10-04 20:30:00", 
    "2017-10-04 20:30:00", "2017-10-08 13:00:00", "2017-10-07 19:00:00", 
    "2017-10-08 18:00:00", "2017-10-08 18:00:00", "2017-10-08 12:15:00", 
    "2017-10-08 18:00:00", "2017-10-08 12:00:00", "2017-10-14 19:45:00", 
    "2017-10-15 12:00:00", "2017-10-14 18:00:00", "2017-10-15 12:15:00", 
    "2017-10-14 18:15:00", "2017-10-13 20:30:00", "2017-10-14 19:00:00", 
    "2017-10-21 18:00:00", "2017-10-21 18:30:00", "2017-10-21 18:30:00", 
    "2017-10-21 18:00:00", "2017-10-21 19:00:00", "2017-10-20 20:45:00", 
    "2017-10-20 21:00:00", "2017-10-29 12:00:00", "2017-10-28 18:00:00", 
    "2017-10-29 12:15:00", "2017-10-28 18:15:00", "2017-10-27 20:30:00", 
    "2017-10-29 19:00:00", "2017-10-28 20:00:00", "2017-11-04 18:00:00", 
    "2017-11-04 20:00:00", "2017-11-04 18:00:00", "2017-11-05 18:00:00", 
    "2017-11-03 20:45:00", "2017-11-04 19:45:00", "2017-11-05 12:00:00", 
    "2017-11-19 12:30:00", "2017-11-19 18:00:00", "2017-11-19 18:15:00", 
    "2017-11-19 12:30:00", "2017-11-19 18:00:00", "2017-11-19 19:00:00", 
    "2017-11-18 19:00:00", "2017-09-28 20:30:00"), audience = c(0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), fecha_insert = c("2017-10-03 12:58:39", 
    "2017-10-03 12:58:47", "2017-10-03 12:58:55", "2017-10-03 13:03:03", 
    "2017-10-03 13:03:13", "2017-10-03 13:03:21", "2017-10-03 13:03:30", 
    "2017-10-04 23:23:07", "2017-10-04 23:23:13", "2017-10-04 23:23:19", 
    "2017-10-04 23:23:25", "2017-10-04 23:23:31", "2017-10-04 23:23:36", 
    "2017-10-04 23:23:42", "2017-10-08 20:57:09", "2017-10-08 20:57:14", 
    "2017-10-08 20:57:19", "2017-10-08 20:57:25", "2017-10-08 20:57:30", 
    "2017-10-08 20:57:36", "2017-10-08 20:57:42", "2017-10-15 16:30:27", 
    "2017-10-15 16:30:35", "2017-10-15 16:30:41", "2017-10-15 16:30:47", 
    "2017-10-15 16:30:53", "2017-10-15 16:30:59", "2017-10-15 16:31:06", 
    "2017-10-22 15:48:47", "2017-10-22 15:48:53", "2017-10-22 15:48:59", 
    "2017-10-22 15:49:05", "2017-10-22 15:49:11", "2017-10-22 15:49:17", 
    "2017-10-22 15:49:22", "2017-10-29 22:40:28", "2017-10-29 22:40:34", 
    "2017-10-29 22:40:39", "2017-10-29 22:40:45", "2017-10-29 22:40:51", 
    "2017-10-29 22:40:56", "2017-10-29 22:41:01", "2017-11-05 20:42:43", 
    "2017-11-05 20:42:49", "2017-11-05 20:42:55", "2017-11-05 20:43:01", 
    "2017-11-05 20:43:08", "2017-11-05 20:43:13", "2017-11-05 20:43:19", 
    "2017-11-19 21:17:57", "2017-11-19 21:18:06", "2017-11-19 21:18:15", 
    "2017-11-19 21:18:26", "2017-11-19 21:18:37", "2017-11-19 21:18:48", 
    "2017-11-19 21:18:59", "2017-10-03 12:57:48")), .Names = c("id", 
"id_jornada", "id_club_home", "id_club_visitor", "home_score", 
"visitor_score", "place", "fecha", "audience", "fecha_insert"
), row.names = c(NA, -57L), class = "data.frame")

我的所有代码......

library(RMySQL)
con <- dbConnect(RMySQL::MySQL(), user='root', password='123456', dbname='estadisticas')
fileconn<-file("files/select-teams-liga-dia.sql","r")
sqlString<-readLines(fileconn)
rs <- dbSendQuery(con, sqlString)
teams <- fetch(rs, n=-1)
fileconn<-file("files/select-games-liga-dia.sql", "r")
sqlString<-readLines(fileconn)
rs <- dbSendQuery(con, sqlString)
games <- fetch(rs, n=-1)
fileconn <- file("files/select-boxscore-liga-dia.sql", "r")
sqlString <- readLines(fileconn)
rs <- dbSendQuery(con, sqlString)
boxScore <- fetch(rs, n=-1)
pointsScored <- vector("integer", length=nrow(teams))
pointsReceived <- vector("integer", length=nrow(teams))
for (j in 1:nrow(teams)){
  row <- teams[j,]
  print(paste(c("idTeam: ", row["idTeam"]), collapse = ""))
  homeGames <- subset(games, id_club_home == row["idTeam"])
  print(paste(c("Length: ", length(homeGames)), collapse = " "))
  print(paste(c("Total rows: ", nrow(homeGames)), collapse = " "))
}

编辑II:

如果我在循环中逐行运行代码,将j的值设置为1.我有一个空子集,我不知道原因:

  j <- 1
  row <- teams[j,]
  print(paste(c("idTeam: ", row["idTeam"]), collapse = ""))
  homeGames <- subset(games, id_club_home == row["idTeam"])
  print(paste(c("Length: ", length(homeGames)), collapse = " "))
  print(paste(c("Total rows: ", nrow(homeGames)), collapse = " "))

我从代码中获得的输出是......

> j <- 1
> row <- teams[j,]
> print(paste(c("idTeam: ", row["idTeam"]), collapse = ""))
[1] "idTeam: 1"
> homeGames <- subset(games, id_club_home == row["idTeam"])
> print(paste(c("Length: ", length(homeGames)), collapse = " "))
[1] "Length:  10"
> print(paste(c("Total rows: ", nrow(homeGames)), collapse = " "))
[1] "Total rows:  0"

如果我们通过id_club_home = 1过滤游戏,我们就有了......

enter image description here

我得到的是一个空子集:(如果我使用此代码创建子集:

homeGames <- subset(games, id_club_home == 1)

homeGames有数据!!! row [“idTeam”]就像我们在代码的输出中看到的那样,返回1.我什么都不懂:(

为什么 homeGames&lt; - subset(games,id_club_home == row [“idTeam”])返回空数据框和 homeGames&lt; - subset(games,id_club_home == 1) 返回带有数据的数据框? :(

编辑III:

当我向数据库进行查询时,当我获得将要保存在游戏数据帧中的数据时,我收到了此警告:

Warning messages:
1: In .local(conn, statement, ...) :
  Unsigned INTEGER in col 0 imported as numeric
2: In .local(conn, statement, ...) :
  Unsigned INTEGER in col 1 imported as numeric
3: In .local(conn, statement, ...) :
  Unsigned INTEGER in col 2 imported as numeric
4: In .local(conn, statement, ...) :
  Unsigned INTEGER in col 3 imported as numeric
5: In .local(conn, statement, ...) :
  Unsigned INTEGER in col 4 imported as numeric
6: In .local(conn, statement, ...) :
  Unsigned INTEGER in col 5 imported as numeric
7: In .local(conn, statement, ...) :
  Unsigned INTEGER in col 8 imported as numeric

这可能是问题吗?我该如何解决?

编辑IV:

很抱歉,但是我会对这个错误感到疯狂......如果我将j的设置更改为10 ...我们有数据!但这些都不正确!!!

我的代码:

  j <- 10
  row <- teams[j,]
  print(paste(c("idTeam: ", row[["idTeam"]]), collapse = ""))
  homeGames <- subset(games, id_club_home == row["idTeam"])
  print(paste(c("Length: ", length(homeGames)), collapse = " "))
  print(paste(c("Total rows: ", nrow(homeGames)), collapse = " "))

我的代码输出:

> j <- 10
> row <- teams[j,]
> print(paste(c("idTeam: ", row[["idTeam"]]), collapse = ""))
[1] "idTeam: 10"
> homeGames <- subset(games, id_club_home == row["idTeam"])
> #awayGames <- subset(games, id_club_visitor == row["idTeam"])
>   print(paste(c("Length: ", length(homeGames)), collapse = " "))
[1] "Length:  10"
> print(paste(c("Total rows: ", nrow(homeGames)), collapse = " "))
[1] "Total rows:  57"

如果我们从游戏中进行转储,我们就会......

dput(homeGames)

structure(list(id = c(2, 3, 4, 5, 6, 7, 8, 23, 24, 25, 26, 27, 
28, 29, 30, 31, 32, 33, 34, 35, 36, 51, 52, 53, 54, 55, 56, 57, 
72, 73, 74, 75, 76, 77, 78, 93, 94, 95, 96, 97, 98, 99, 135, 
136, 137, 138, 139, 140, 141, 169, 170, 171, 172, 173, 174, 175, 
1), id_jornada = c(2, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 6, 
7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10, 10, 10, 13, 13, 13, 
13, 13, 13, 13, 16, 16, 16, 16, 16, 16, 16, 19, 19, 19, 19, 19, 
19, 19, 24, 24, 24, 24, 24, 24, 24, 1), id_club_home = c(10, 
13, 7, 3, 14, 6, 5, 1, 2, 12, 7, 8, 4, 9, 10, 14, 6, 7, 5, 3, 
1, 2, 12, 11, 8, 4, 9, 13, 10, 6, 7, 5, 3, 1, 2, 12, 11, 8, 4, 
9, 13, 14, 10, 7, 5, 3, 1, 2, 12, 11, 8, 4, 9, 13, 14, 6, 10), 
    id_club_visitor = c(9, 4, 12, 1, 8, 11, 2, 10, 3, 5, 11, 
    6, 14, 13, 13, 9, 4, 8, 11, 12, 2, 10, 1, 3, 5, 7, 6, 14, 
    14, 13, 9, 4, 8, 11, 12, 10, 2, 1, 3, 5, 7, 6, 6, 14, 13, 
    9, 4, 8, 11, 10, 12, 2, 1, 3, 5, 7, 13), home_score = c(82, 
    71, 73, 55, 90, 63, 72, 52, 79, 59, 78, 79, 56, 71, 76, 73, 
    72, 68, 64, 80, 68, 48, 67, 80, 68, 77, 59, 72, 50, 53, 101, 
    58, 67, 83, 62, 48, 66, 72, 74, 57, 80, 78, 69, 89, 72, 68, 
    72, 59, 83, 50, 69, 85, 75, 74, 71, 73, 61), visitor_score = c(58, 
    53, 80, 83, 81, 54, 68, 83, 53, 64, 58, 55, 66, 84, 53, 63, 
    63, 75, 40, 81, 79, 64, 79, 73, 73, 78, 73, 54, 54, 88, 51, 
    64, 86, 72, 69, 91, 74, 59, 53, 68, 70, 74, 54, 82, 66, 62, 
    59, 76, 60, 88, 75, 79, 87, 52, 61, 62, 55), place = c("ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", "ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", "ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", "ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "PAB. MUNIC. \"JUAN SERRANO MACAYO\", C\xe1ceres (C\xe1ceres)", 
    "PALAU MUNICIPAL D\xb4ESPORTS, Seu d'Urgell, La (Lleida)", 
    "PABELLON MUNICIPAL MARINA BESOS, Sant Adri\xe0 de Bes\xf2s (Barcelona)", 
    "POL. MALOSTE, Gernika-Lumo (Vizcaya)", "PAB.POLDVO. EDUARDO LASTRADA (STADIUM CASABLANCA), Zaragoza (Zaragoza)", 
    "PABELLON BEMBIBRE ARENA, Bembibre (Le\xf3n)", "1018-ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "PABELLON MUNICIPAL WURZBURG, Salamanca (Salamanca)", "PAV. MUNICIPAL  ESTEIRO, Ferrol (A Coru\xf1a)", 
    "POLIDEPORTIVO MENDIZORROTZA, Vitoria-Gasteiz (\xc1lava)", 
    "POL. MALOSTE, Gernika-Lumo (Vizcaya)", "POL. JOSE ANTONIO GASCA, Donostia-San Sebasti\xe1n (Guip\xfazcoa)", 
    "Palacio de los Deportes de La Rioja, Logro\xf1o (La Rioja)", 
    "PAB. MUNIC. \"JUAN SERRANO MACAYO\", C\xe1ceres (C\xe1ceres)", 
    "PALAU MUNICIPAL D\xb4ESPORTS, Seu d'Urgell, La (Lleida)", 
    "PABELLON MUNICIPAL MARINA BESOS, Sant Adri\xe0 de Bes\xf2s (Barcelona)", 
    "PABELLON MUNICIPAL ANGEL NIETO, Zamora (Zamora)", "PAB.POLDVO. EDUARDO LASTRADA (STADIUM CASABLANCA), Zaragoza (Zaragoza)", 
    "PABELLON BEMBIBRE ARENA, Bembibre (Le\xf3n)", "1018-ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "PAVELL\xd3N MUNICIPAL GIRONA FONTAJAU, Girona (Girona)", 
    "PABELLON MUNICIPAL WURZBURG, Salamanca (Salamanca)", "POLIDEPORTIVO MENDIZORROTZA, Vitoria-Gasteiz (\xc1lava)", 
    "POL. MALOSTE, Gernika-Lumo (Vizcaya)", "POL. JOSE ANTONIO GASCA, Donostia-San Sebasti\xe1n (Guip\xfazcoa)", 
    "Palacio de los Deportes de La Rioja, Logro\xf1o (La Rioja)", 
    "PAB. MUNIC. \"JUAN SERRANO MACAYO\", C\xe1ceres (C\xe1ceres)", 
    "PALAU MUNICIPAL D\xb4ESPORTS, Seu d'Urgell, La (Lleida)", 
    "PABELLON MUNICIPAL MARINA BESOS, Sant Adri\xe0 de Bes\xf2s (Barcelona)", 
    "PABELLON MUNICIPAL ANGEL NIETO, Zamora (Zamora)", "PAB.POLDVO. EDUARDO LASTRADA (STADIUM CASABLANCA), Zaragoza (Zaragoza)", 
    "PABELLON BEMBIBRE ARENA, Bembibre (Le\xf3n)", "1018-ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "PAVELL\xd3N MUNICIPAL GIRONA FONTAJAU, Girona (Girona)", 
    "PAV. MUNICIPAL  ESTEIRO, Ferrol (A Coru\xf1a)", "PABELLON MUNICIPAL WURZBURG, Salamanca (Salamanca)", 
    "POL. MALOSTE, Gernika-Lumo (Vizcaya)", "POL. JOSE ANTONIO GASCA, Donostia-San Sebasti\xe1n (Guip\xfazcoa)", 
    "Palacio de los Deportes de La Rioja, Logro\xf1o (La Rioja)", 
    "PAB. MUNIC. \"JUAN SERRANO MACAYO\", C\xe1ceres (C\xe1ceres)", 
    "PALAU MUNICIPAL D\xb4ESPORTS, Seu d'Urgell, La (Lleida)", 
    "PABELLON MUNICIPAL MARINA BESOS, Sant Adri\xe0 de Bes\xf2s (Barcelona)", 
    "PABELLON MUNICIPAL ANGEL NIETO, Zamora (Zamora)", "PAB.POLDVO. EDUARDO LASTRADA (STADIUM CASABLANCA), Zaragoza (Zaragoza)", 
    "PABELLON BEMBIBRE ARENA, Bembibre (Le\xf3n)", "1018-ANTONIO MAGARI\xd1OS, PABELLON, Madrid (Madrid)", 
    "PAVELL\xd3N MUNICIPAL GIRONA FONTAJAU, Girona (Girona)", 
    "PAV. MUNICIPAL  ESTEIRO, Ferrol (A Coru\xf1a)", "POLIDEPORTIVO MENDIZORROTZA, Vitoria-Gasteiz (\xc1lava)", 
    "PABELLON MUNICIPAL WURZBURG, Salamanca (Salamanca)"), fecha = c("2017-09-30 18:00:00", 
    "2017-09-30 13:15:00", "2017-09-30 20:15:00", "2017-09-30 11:00:00", 
    "2017-10-01 16:00:00", "2017-10-01 10:00:00", "2017-10-01 12:15:00", 
    "2017-10-04 20:30:00", "2017-10-04 21:00:00", "2017-10-04 20:30:00", 
    "2017-10-04 20:00:00", "2017-10-04 19:00:00", "2017-10-04 20:30:00", 
    "2017-10-04 20:30:00", "2017-10-08 13:00:00", "2017-10-07 19:00:00", 
    "2017-10-08 18:00:00", "2017-10-08 18:00:00", "2017-10-08 12:15:00", 
    "2017-10-08 18:00:00", "2017-10-08 12:00:00", "2017-10-14 19:45:00", 
    "2017-10-15 12:00:00", "2017-10-14 18:00:00", "2017-10-15 12:15:00", 
    "2017-10-14 18:15:00", "2017-10-13 20:30:00", "2017-10-14 19:00:00", 
    "2017-10-21 18:00:00", "2017-10-21 18:30:00", "2017-10-21 18:30:00", 
    "2017-10-21 18:00:00", "2017-10-21 19:00:00", "2017-10-20 20:45:00", 
    "2017-10-20 21:00:00", "2017-10-29 12:00:00", "2017-10-28 18:00:00", 
    "2017-10-29 12:15:00", "2017-10-28 18:15:00", "2017-10-27 20:30:00", 
    "2017-10-29 19:00:00", "2017-10-28 20:00:00", "2017-11-04 18:00:00", 
    "2017-11-04 20:00:00", "2017-11-04 18:00:00", "2017-11-05 18:00:00", 
    "2017-11-03 20:45:00", "2017-11-04 19:45:00", "2017-11-05 12:00:00", 
    "2017-11-19 12:30:00", "2017-11-19 18:00:00", "2017-11-19 18:15:00", 
    "2017-11-19 12:30:00", "2017-11-19 18:00:00", "2017-11-19 19:00:00", 
    "2017-11-18 19:00:00", "2017-09-28 20:30:00"), audience = c(0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), fecha_insert = c("2017-10-03 12:58:39", 
    "2017-10-03 12:58:47", "2017-10-03 12:58:55", "2017-10-03 13:03:03", 
    "2017-10-03 13:03:13", "2017-10-03 13:03:21", "2017-10-03 13:03:30", 
    "2017-10-04 23:23:07", "2017-10-04 23:23:13", "2017-10-04 23:23:19", 
    "2017-10-04 23:23:25", "2017-10-04 23:23:31", "2017-10-04 23:23:36", 
    "2017-10-04 23:23:42", "2017-10-08 20:57:09", "2017-10-08 20:57:14", 
    "2017-10-08 20:57:19", "2017-10-08 20:57:25", "2017-10-08 20:57:30", 
    "2017-10-08 20:57:36", "2017-10-08 20:57:42", "2017-10-15 16:30:27", 
    "2017-10-15 16:30:35", "2017-10-15 16:30:41", "2017-10-15 16:30:47", 
    "2017-10-15 16:30:53", "2017-10-15 16:30:59", "2017-10-15 16:31:06", 
    "2017-10-22 15:48:47", "2017-10-22 15:48:53", "2017-10-22 15:48:59", 
    "2017-10-22 15:49:05", "2017-10-22 15:49:11", "2017-10-22 15:49:17", 
    "2017-10-22 15:49:22", "2017-10-29 22:40:28", "2017-10-29 22:40:34", 
    "2017-10-29 22:40:39", "2017-10-29 22:40:45", "2017-10-29 22:40:51", 
    "2017-10-29 22:40:56", "2017-10-29 22:41:01", "2017-11-05 20:42:43", 
    "2017-11-05 20:42:49", "2017-11-05 20:42:55", "2017-11-05 20:43:01", 
    "2017-11-05 20:43:08", "2017-11-05 20:43:13", "2017-11-05 20:43:19", 
    "2017-11-19 21:17:57", "2017-11-19 21:18:06", "2017-11-19 21:18:15", 
    "2017-11-19 21:18:26", "2017-11-19 21:18:37", "2017-11-19 21:18:48", 
    "2017-11-19 21:18:59", "2017-10-03 12:57:48")), .Names = c("id", 
"id_jornada", "id_club_home", "id_club_visitor", "home_score", 
"visitor_score", "place", "fecha", "audience", "fecha_insert"
), row.names = c(NA, 57L), class = "data.frame")

这是不正确的,因为对于id_club_home,我们的值得分为10.解决方案是......

enter image description here

0 个答案:

没有答案