I have here a dataframe (flights\_delay): 
[![enter image description here](https://i.stack.imgur.com/EfBKA.png)](https://i.stack.imgur.com/EfBKA.png)

In this dataframe (flights\_delay), i have duplicate destinations (in the "dest" column). I am trying to get the average delay ("avg\_delay" column) by destination ("dest" column). I have tried this code:

```
sum_avg_delay <- aggregate(avg_delay~dest,flights_delay,sum)$avg_delay

```

Unfortunately, I get a vector of numbers without any destination labels.

I've also tried the `dplyr::summarise` function, but this returns an error.

There must be a simpler way to get the average delay by destination.