rm_empty_col function

Remove empty columns

Remove empty columns

This function removes columns filled with NA or 0 from a dataframe.

rm_empty_col(x)

Arguments

  • x: A dataframe

Returns

a dataframe.

Details

This function is mainly used inside other functions, to remove optional variables when they are not opted in.

Examples

library(forestmangr) library(dplyr) data("exfm15") head(exfm15) exfm15 %>% mutate(emptycol=NA) %>% rm_empty_col

Author(s)

Sollano Rabelo Braga sollanorb@gmail.com

  • Maintainer: Sollano Rabelo Braga
  • License: MIT + file LICENSE
  • Last published: 2024-12-01