[r] How to count the number of observations in R like Stata command count