How to do location disaggregated analysis

Suppose I've a following database:
Location name Food received
Dhaka Yes
Dhaka Yes
Chittagong Yes
Rajshahi Yes
Chittagong No
Chittagong Yes
Rajshahi No

Now, if I want to do a simple analysis like "How many people received food disaggregated by different location" then how should I do it?

Thanks in advance for your support.

(food1 <- data.frame(
  stringsAsFactors = FALSE,
  locationname = c("Dhaka","Dhaka","Chittagong",
                   "Rajshahi","Chittagong","Chittagong","Rajshahi"),
  foodreceived = c("Yes", "Yes", "Yes", "Yes", "No", "Yes", "No")
))


library(tidyverse)
food1 %>% 
  group_by_all() %>% 
  count() %>% 
  pivot_wider(values_from = "n",
              names_from="foodreceived")

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.