Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rm_empty_col

Remove empty columns


Description

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

Usage

rm_empty_col(x)

Arguments

x

A dataframe

Details

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

Value

a dataframe.

Author(s)

Sollano Rabelo Braga sollanorb@gmail.com

Examples

library(forestmangr)
library(dplyr)
data("exfm15")
head(exfm15)

exfm15 %>% 
mutate(emptycol=NA) %>% 
rm_empty_col

forestmangr

Forest Mensuration and Management

v0.9.3
MIT + file LICENSE
Authors
Sollano Rabelo Braga [aut, cre, cph], Marcio Leles Romarco de Oliveira [aut], Eric Bastos Gorgens [aut]
Initial release
2021-01-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.