'Str()' is an enhanced 'str()'. 'Str()' (1) shows data frame structure
with column indexes, (2) indicates presence of NA(s) with star (*) and
(3) lists first five row names, if they are not default.
If the object is a data frame with atomic columns, this function captures
output of internal 'str()', changes it and outputs the new one. If the
object is not a data frame or is a data frame with non-atomic columns,
then output is not changed.
If 'as.factor=TRUE', converts all character columns to factors before
reporting the structure, thus mimicking pre-R4 behavior of many functions
related with data frames (and also invisibly outputs the new data frame).
Might be useful, for example, to understand the number of unique
character values which will be shown as "factor levels", works well in
conjunction with summary(), please see examples.
Alternative: DescTools::Str() which uses cycles (slower!), has less
features, but works with non-atomic columns.