I have 12 raster images which I stack them. Then I converted the rasterstack to a matrix, I remove the NA's from the matrix and I convert the matrix to monthly time-series matrix. Finally, I run the bfastlite function, like so:
library(bfast)
library(raster)
wd