For different analysis, I use different samples, but I need to make it transparent how the sample came about. Stata shows me "XX observations dropped" after each drop command. Is there a way to get R to state the number of observations dropped in the console during a "tidyverse styled" sample selection (see below)? In this example I would like to see in the console how many observations were dropped with the filter command and the drop_na command. I tried summarise_all(~sum(is.na(.)))
but it was unsuccessful.
capmkt_df <- stata_df %>%
filter(change != 1 & reg_mkt == 1) %>%
select(any_of(capmkt_vars)) %>%
mutate_at(vars(country, year), factor) %>%
drop_na()