Useful to remove unmapped columns extracted from EcoTaxa, which are all full of NAs.

remove_empty_cols(x)

Arguments

x

a data.frame.

Value

The input data.frame with the columns that are full of NAs removed

Examples

x <- data.frame(a=c(1,NA), b=NA, c=c(NA, "foo")) x
#> a b c #> 1 1 NA <NA> #> 2 NA NA foo
remove_empty_cols(x)
#> a c #> 1 1 <NA> #> 2 NA foo