typeOf package:inline-r

Return the "type" tag (aka the form tag) of the given SEXP. This function is pure because the type of an object does not normally change over the lifetime of the object.
Returns type of the current SEXP. Can never fail.
Cast form of first argument to that of the second argument.