I have an R data frame , and some of the variables are categorical. For example, sex is โmanโ or โwoman,โ and โyou smokeโ is 0 or 1. Other variables are continuous instead. I would like to know if there is a way to decide whether a variable is categorical or not, and if its frequencies are calculated.
I think in my case a good test would be to check if a variable accepts less than k = 4.
source
share