Calculate a Rolling Slope In R

Hi
Im trying to calculate a rolling 7 day slope.
I am using a slope function.

rollingSlope.lm.fit <- function(vector) {
a <- coef(.lm.fit(cbind(1, seq(vector)), vector))[2]
return(a)
}

data$seven_day_slope<-rollapply(data$variable width=7, FUN=rollingSlope.lm.fit,fill=NA)

When trying to calculate slope for rolling 7 days.
My Dataset is 46 rows. 2 Columns Variable and date.
Calculating rolling slope results in Nas, for top 3 and bottom 3 values in dataset.
Id expect oldest 6 values to. be NAs as they are used to calculate the first 7 day value.

Has anyone had a similiar encounter?