jokecamp / FootballData

A hodgepodge of JSON and CSV Football/Soccer data
MIT License
675 stars 375 forks source link

goals and cards time #37

Open ainureg opened 6 years ago

ainureg commented 6 years ago
> json<-listfiles[1]
> temp<-fromJSON(json)
> tail( sapply( temp$matches,  function (z) sapply(z$goalHome, function (x) {x$time} ) )   )
$`457`
   1    2    3    4    5    6    7 
 "7" "16" "43" "48" "85" "88" "76" 

$`458`
   1    2    3    4    5    6    7 
"67" "78" "43" "48" "85" "88" "76" 

$`459`
   1    2    3    4    5    6    7 
"81" "78" "43" "48" "85" "88" "76" 

$`460`
   1    2    3    4    5    6    7 
"52" "78" "43" "48" "85" "88" "76" 

$`461`
   1    2    3    4    5    6    7 
"27" "31" "67" "48" "85" "88" "76" 

$`462`
   1    2    3    4    5    6    7 
"61" "31" "67" "48" "85" "88" "76" 

is there a mistake? the same is about cards minutes file English_Premier_League_1992-1993.json

jokecamp commented 6 years ago

No problem. what's the mistake exactly? hard to read that formatted text.

ainureg commented 6 years ago

all the information in data is ok, except times

even no matching the number of scored

> temp$matches$`462`$goalAway

$`1`
$`1`$name
[1] "Matt Le Tissier"

$`1`$time
[1] "45"

$`1`$desc
[1] "Penalty"

$`2`
$`2`$name
[1] "Neil Maddison"

$`2`$time
[1] "52"

$`2`$desc
[1] "Own Goal"

$`3`
$`3`$name
[1] "Matt Le Tissier"

$`3`$time
[1] "65"

$`3`$desc
[1] "Penalty"

$`4`
$`4`$name
[1] "Brian Deane"

$`4`$time
[1] "67"

$`5`
$`5`$name
[1] "Chris Fairclough"

$`5`$time
[1] "90"

> 
> temp$matches$`462`$score
$home
[1] "Manchester United"

$away
[1] "Coventry City"

$homeScore
[1] "0"

$awayScore
[1] "0"

this output is for next file "English_Premier_League_1993-1994.json" footballStats/English_Premier_League/