I am new to R and I am trying to simply remove many columns using a for loop

```
for (i in 15:ncol(DB)){
    BD[,i]<- NULL
}

```

But I keep on getting this error:

```
 Error in `[<-.data.frame`(`*tmp*`, , i, value = NULL) : 
 new columns would leave holes after existing columns 

```

Could someone explain why this is happening?
Thanks