How to remove the 0 in the table summary when using top_n with dplyr?
library(ggplot2)
library(dplyr)
data("diamonds")
diamonds #set diamonds as data.frame
manualTest = diamonds %>%
count(cut) %>%
top_n(3)
table(manualTest$cut)
Result
Fair Good Very Good Premium Ideal
0 0 1 1 1
Expected result
Very Good Premium Ideal
1 1 1