#Load the package library(zoo) #fill by last observed value full documentation: https://www.rdocumentation.org/packages/zoo/versions/1.8-8/topics/na.locf #na.rm option specifies whether leading null values should be removed na.locf(object, na.rm = TRUE, …) #Use next date rather than last date (by default fromLast=False) na.