I am new in R programming. I want to add two consecutive rows of the first column in a table. Here is the function I tried:

```
x <- airquality[ , 1]
fun <- function(x){
for (i in 1: length(x))
y <- sum(x[i,1], x[i+1, 1])
y
}

```

I am not getting any display. 

Please let me know my mistakes. Thanks