Your issue is not specific to shiny
it can be addressed outside of a Shiny App context, see this example (BTW you should make your questions in the form of a REPRoducible EXample (reprex) as the one bellow).
library(dplyr)
sample_data <- head(iris)
sample_data$Sepal.Length <- NA
sample_data
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 NA 3.5 1.4 0.2 setosa
#> 2 NA 3.0 1.4 0.2 setosa
#> 3 NA 3.2 1.3 0.2 setosa
#> 4 NA 3.1 1.5 0.2 setosa
#> 5 NA 3.6 1.4 0.2 setosa
#> 6 NA 3.9 1.7 0.4 setosa
# Filter columns containing only NAs
sample_data %>%
select_if(~!all(is.na(.))) %>%
names()
#> [1] "Sepal.Width" "Petal.Length" "Petal.Width" "Species"
Created on 2020-01-24 by the reprex package (v0.3.0.9000)