```r
# calculer l'indice de charge moyenne
url = "http://vlsstats.ifsttar.fr/data/spatiotemporalstats_Lyon.json"
stationsData = fromJSON(file=url)
res = sapply(stationsData,function(x){
  c(x$'_id', mean(x$available_bikes))})
res = data.frame(t(res),row.names = NULL)
names(res) = c('id','mnbikes')
stations =  stations%>% left_join(res)
```

```
FALSE Joining, by = "id"
```

```r
stations$loading = stations$mnbikes/stations$nbdocks
ti = "Effet de l'altitude sur la charge des stations"
yl = "Indicateur de charge moyenne"
xl = "Altitude (m)"
plot(stations$alt,stations$loading,xlab=xl,ylab=yl,main=ti)
```