There is no function which can do that because it's not a solvable problem.
Take even just the difference between discrete and continuous variables...
Maybe your data has heights, which are measured in inches. Is this variable discrete or continuous? Well, it should be continuous since, as a physical measurement height couple theoretically be measured to, within the bounds of physics, an infinite precision. But... If the data was only measured to the nearest inch, and is stored in the data.frame as an integer value, the data is discrete (there's no fractional inches).
So, to answer this kind of question you need to have an understanding of what the data is measuring (as well as what you intend to do with it).
About example which I usually present to my Intro Stats students is this...
What type of variable is grade in school?
Well... It could be numeric. For instance, you might want to perform a regression on vocabulary size as a function of number of completed years of formal education.
Or... It could be categorical. For instance, if you wanted to analyze student views on a proposed school policy by freshmen, sophomores, juniors, and seniors.
The point is, classifying variables in this way is not always so clear cut, and it's this ambiguity which makes it impossible for software to answer accurately.
If you're hell-bent on it, you could always establish some assumptions and write your own function to do it.
For example, if a variable consists of only integer valued elements in a regular sequence, e.g.
all(sort(df$x) == seq_along(df$x)) == TRUE
You might be comfortable classifying that as an ordinal variable.