xts object corresponding
to the last observations given a period specified by onendpoints(x, on="months", k=1)endpoints returns a numeric vector corresponding to the
last observation in each period specified by on, with a
zero added to the beginning of the vector, and the index of the last
observation in x at the end.Valid values for the argument on include: