There is no automatic way. It takes defining your criteria and checking them. Even then, the best you can do (usually) is categorical vs. continuous (integer) vs. continuous (noninteger). Sometimes you might want to distinguish binary from the other possibilities as well, but you may have to check a larger sample to be confident of a variable being binary. If a variable takes on 20 different values, must it be continuous (not categorical)? What is the limit? If a variable takes on noninteger values, must it be continuous? Any rules you come up with will always have exceptions. For example, you may get a set of integers that represent percentiles, and have 100 possible values. It would be good practice to keep lists of variables that you know about: variables that are always categorical (no matter how many values they take on), and variables that are always continuous (no matter how few values they take on). The checking is usually done on a sample of observations, but I have typically used thousands rather than hundreds of observations. Good luck.
... View more