Open MatthieuStigler opened 5 years ago
For now I would do four distinct counts, mutate, and rbind. See below.
Maybe better:
Old colde:
vars_fld_seq_11 <- vars_fld_seq %>% filter(year>2010) %>% filter(!str_detect(seq_4Y, "NA")) ## all, all Cat coun_seqs_allC_allS <- vars_fld_seq_11%>% count(year, crop, seq_4Y) %>% mutate(st_abb="all", CS_only_cat = "all") ## all, by Cat coun_seqs_byC_allS <- vars_fld_seq_11%>% count(year, crop, CS_only_cat, seq_4Y) %>% mutate(st_abb="all") ## by state, all cat coun_seqs_allC_byS <- vars_fld_seq_11 %>% count(year, crop, seq_4Y, st_abb) %>% mutate(CS_only_cat = "all") ## by state, all cat coun_seqs_byC_byS <- vars_fld_seq_11 %>% count(year, crop, CS_only_cat, seq_4Y, st_abb) ## assemble coun_seqs_all <- rbind(coun_seqs_allC_allS, coun_seqs_byC_allS, coun_seqs_byC_byS, coun_seqs_allC_byS)
For now I would do four distinct counts, mutate, and rbind. See below.
Maybe better:
Old colde: