z <- tibble(rnorm(100, 25, 2))
class(z)
[1] "tbl_df" "tbl" "data.frame"
stats_metric(z)
Error in stats_metric(z) (analyzing_functions.R#41): x has to be a data.frame
Fix:
Replacing if (any(class(x) != 'data.frame')) with if (!any(class(x) == 'data.frame'))
Example:
Fix: Replacing
if (any(class(x) != 'data.frame'))
withif (!any(class(x) == 'data.frame'))