n_observations function

Extract number of observations stored in an object