Counting rows in SAS and R is approached differently, because the two programs process data in different ways. Read my blog post where I describe both ways.
I use the datasets from the Behavioral Risk Factor Surveillance Survey (BRFSS) to demonstrate in a lot of my data science tutorials. The BRFSS are free and available to the public – but they are kind of buried on the web site. This blog post serves as a “map” to help you find them!