I have a dataframe, namely 'Beta_corr_only_Significant', in R which contains several rows (>700), all of which that contain some NAs. What I would like to do is to generate a second dataframe, copy of the first one, but without all the rows in which ALL the values are NAs.
I have tried using this command with the help of the {dplyr} package:
Beta_corr_noNAs <- Beta_corr_only_Significant %>%
filter(if_any(everything(), ~ !is.na(.)))
But keep receiving this error message:
Error in UseMethod("filter") :
no applicable method for 'filter' applied to an object of class "c('matrix', 'array', 'double', 'numeric')"
And I am not sure why that is the case. The object I am trying to manipulate is a dataframe generated using the corr.test command, from the {psych} package in R.