The message means departures doesn't have list-like properties. This means departures may not be what you think it is.
So first see what departures is by looking at class(departures) (also typeof(), summary(), and str() are good tries).
Then you can research why departures is what it is (look into how you brought it in).