I have a dataframe that looks like:
example<- data.frame(interact= c("A_X", "", "", "D_W", "E_Q", "A_X"),
region= seq(1,6, 1), loc= seq(20, 25, 1))
I would like to summarize the freqency of the interact
column but only for those with entries. My current method is returning counts of blank rows.
Here is the output for the example I would like:
output<- data.frame(interact= c("A_X","D_W", "E_Q"),
freq= c(2, 1,1))
Here is the code I have tried, but it returns the sum of the blank rows as well:
output<-example %>%
group_by(interact) %>%
summarise(freq = n())