#i <- 1

ransomware_big_families <- ransomware %>% 
  group_by(label) %>% filter(n() > 1) %>% 
  ungroup()

ransomware_big_families <- ransomware_big_families %>% mutate(income = as.numeric(income))


for(i in 1:length(levels(ransomware_big_families$label))){
 ggp <-
  ransomware_big_families %>% filter(label==levels(ransomware_big_families$label)[i]) %>% 
  select(income) %>% 
  ggplot(aes(x=income,  y = ..density..)) +
#    geom_histogram(bins="30") +
#     geom_bar() +
     geom_density(col = "green", size = .5)+
    ggtitle(levels(ransomware_big_families$label)[i]) +
    scale_x_continuous(trans='log2') 
  print(ggp)
  print(i)
  print(levels(ransomware_big_families$label)[i])
}

