trim_na function

Trim the unneeded NA values from the end of the sampler