I am trying to create a correlation matrix plot that only shows the significant correlations (p < .05) among a very large dataset. The point is to avoid doing individual correlations with each possible combination of 2 variables, which would take a lot of time.
Here is the code I'm using:
df_cor <- mtcars %>% mutate_if(is.character, as.factor)
df_cor <- df_cor %>% mutate_if(is.factor, as.numeric)
even using the mtcars dataframe and it produces the following error:
Error in UseMethod("tbl_vars") : no applicable method for 'tbl_vars' applied to an object of class "function"
I found this related question, but it seems to be a problem of not passing an actual dataframe instead of something else.