R for Public Health
Department of Community Medicine, MGIMS
25 Sep 2024
plotData %>%
ggplot(aes(x = wt,
y = ht,
colour = age,
size = edu)) +
labs(x = "Weight (kg)",
y = "Height (m)",
title = "Scatter plot of Height against Weight",
subtitle = "10-30 year individuals from Wardha",
caption = "Data Source: VCAN Project, DCM, MGIMS") +
geom_point() +
facet_wrap(vars(phc)) +
scale_x_log10() +
scale_y_log10()
plotData %>%
ggplot(aes(x = wt,
y = ht,
colour = age,
size = edu)) +
labs(x = "Weight (kg)",
y = "Height (m)",
title = "Scatter plot of Height against Weight",
subtitle = "10-30 year individuals from Wardha",
caption = "Data Source: VCAN Project, DCM, MGIMS") +
geom_point() +
facet_wrap(vars(phc)) +
scale_x_log10() +
scale_y_log10() +
theme_minimal()
plotData %>%
ggplot(aes(x = wt,
y = ht,
colour = age,
size = edu)) +
labs(x = "Weight (kg)",
y = "Height (m)",
title = "Scatter plot of Height against Weight",
subtitle = "10-30 year individuals from Wardha",
caption = "Data Source: VCAN Project, DCM, MGIMS") +
geom_point() +
facet_wrap(vars(phc)) +
scale_x_log10() +
scale_y_log10() +
theme_minimal() +
theme(legend.position = "bottom")
plotData %>%
ggplot(aes(x = wt,
y = ht,
colour = age,
size = edu)) +
labs(x = "Weight (kg)",
y = "Height (m)",
title = "Scatter plot of Height against Weight",
subtitle = "10-30 year individuals from Wardha",
caption = "Data Source: VCAN Project, DCM, MGIMS") +
geom_point() +
facet_wrap(vars(phc)) +
scale_x_log10() +
scale_y_log10() +
theme_minimal() +
theme(legend.position = "bottom") +
scale_colour_viridis_c()
library(ggthemes)
plotData %>%
ggplot(aes(x = wt,
y = ht,
colour = age,
size = edu)) +
labs(x = "Weight (kg)",
y = "Height (m)",
title = "Scatter plot of Height against Weight",
subtitle = "10-30 year individuals from Wardha",
caption = "Data Source: VCAN Project, DCM, MGIMS") +
geom_point() +
facet_wrap(vars(phc), strip.position = "bottom") +
scale_x_log10() +
scale_y_log10() +
theme_stata() +
theme(legend.position = "bottom") +
scale_colour_viridis_c()
library(sf)
shp <- st_read(dsn = "shape_files/war_vil.shp")
wardha <- fortify(shp)
map_data <- read.csv("map_data.csv")%>%
mutate(popcat = case_when(ind >= 5000 ~ ">5000",
ind >= 2000 & ind < 5000 ~ "2000-5000",
ind >= 1000 & ind < 2000 ~ "1000-2000",
ind >= 500 & ind < 1000 ~ "500-1000",
ind < 500 ~ "<500")) %>%
filter(!is.na(census_id))
map <- wardha %>%
left_join(map_data,
by = c("CEN_2011"="census_id"))
GT Table
X | village | hh | ind | census_id | description_english | popcat |
---|---|---|---|---|---|---|
1 | 1 | 1599 | 5792 | 534052 | Anji | >5000 |
2 | 2 | 259 | 920 | 534046 | Kamthi Khanapur | 500-1000 |
3 | 3 | 3 | 6 | 534049 | Sewa | <500 |
4 | 4 | 229 | 744 | 534045 | Chaka Majara | 500-1000 |
5 | 5 | 284 | 1071 | 534051 | Pavnur | 1000-2000 |
6 | 6 | 570 | 1990 | 534054 | Mandawa | 1000-2000 |
7 | 7 | 237 | 779 | 534055 | Pulai | 500-1000 |
8 | 8 | 150 | 524 | 534056 | Peth | 500-1000 |
9 | 9 | 193 | 700 | 534057 | Borgaon (Sawali) | 500-1000 |
10 | 10 | 133 | 462 | 534060 | Borgaon (Nandora) | <500 |
Sevagram HDSS |
||||||
---|---|---|---|---|---|---|
Population Details | ||||||
X | village | hh | ind | census_id | description_english | popcat |
1 | 1 | 1599 | 5792 | 534052 | Anji | >5000 |
2 | 2 | 259 | 920 | 534046 | Kamthi Khanapur | 500-1000 |
3 | 3 | 3 | 6 | 534049 | Sewa | <500 |
4 | 4 | 229 | 744 | 534045 | Chaka Majara | 500-1000 |
5 | 5 | 284 | 1071 | 534051 | Pavnur | 1000-2000 |
6 | 6 | 570 | 1990 | 534054 | Mandawa | 1000-2000 |
7 | 7 | 237 | 779 | 534055 | Pulai | 500-1000 |
8 | 8 | 150 | 524 | 534056 | Peth | 500-1000 |
9 | 9 | 193 | 700 | 534057 | Borgaon (Sawali) | 500-1000 |
10 | 10 | 133 | 462 | 534060 | Borgaon (Nandora) | <500 |
Sevagram HDSS |
||||||
---|---|---|---|---|---|---|
Population Details | ||||||
X | village | hh | ind | census_id | description_english | popcat |
1 | 1 | 1599 | 5792 | 534052 | Anji | >5000 |
2 | 2 | 259 | 920 | 534046 | Kamthi Khanapur | 500-1000 |
3 | 3 | 3 | 6 | 534049 | Sewa | <500 |
4 | 4 | 229 | 744 | 534045 | Chaka Majara | 500-1000 |
5 | 5 | 284 | 1071 | 534051 | Pavnur | 1000-2000 |
6 | 6 | 570 | 1990 | 534054 | Mandawa | 1000-2000 |
7 | 7 | 237 | 779 | 534055 | Pulai | 500-1000 |
8 | 8 | 150 | 524 | 534056 | Peth | 500-1000 |
9 | 9 | 193 | 700 | 534057 | Borgaon (Sawali) | 500-1000 |
10 | 10 | 133 | 462 | 534060 | Borgaon (Nandora) | <500 |
Source: Wave 1, Sevagram HDSS |
map_data %>%
head(n = 10) %>%
gt() %>%
tab_header(title = md("**Sevagram HDSS**"),
subtitle = "Population Details") %>%
tab_source_note(source_note = md("**Source:** Wave 1, Sevagram HDSS")) %>%
tab_footnote(footnote = "Large Village",
locations = cells_body(columns = description_english,
rows = ind > 5000))
Sevagram HDSS |
||||||
Population Details | ||||||
X | village | hh | ind | census_id | description_english | popcat |
---|---|---|---|---|---|---|
1 | 1 | 1599 | 5792 | 534052 | Anji1 | >5000 |
2 | 2 | 259 | 920 | 534046 | Kamthi Khanapur | 500-1000 |
3 | 3 | 3 | 6 | 534049 | Sewa | <500 |
4 | 4 | 229 | 744 | 534045 | Chaka Majara | 500-1000 |
5 | 5 | 284 | 1071 | 534051 | Pavnur | 1000-2000 |
6 | 6 | 570 | 1990 | 534054 | Mandawa | 1000-2000 |
7 | 7 | 237 | 779 | 534055 | Pulai | 500-1000 |
8 | 8 | 150 | 524 | 534056 | Peth | 500-1000 |
9 | 9 | 193 | 700 | 534057 | Borgaon (Sawali) | 500-1000 |
10 | 10 | 133 | 462 | 534060 | Borgaon (Nandora) | <500 |
Source: Wave 1, Sevagram HDSS |
||||||
1 Large Village |
map_data %>%
head(n = 10) %>%
gt() %>%
tab_header(title = md("**Sevagram HDSS**"),
subtitle = "Population Details") %>%
tab_source_note(source_note = md("**Source:** Wave 1, Sevagram HDSS")) %>%
tab_footnote(footnote = "Large Village",
locations = cells_body(columns = description_english,
rows = ind > 5000)) %>%
tab_spanner(label = "Population details",
columns = c(hh, ind))
Sevagram HDSS |
||||||
Population Details | ||||||
X | village | Population details | census_id | description_english | popcat | |
---|---|---|---|---|---|---|
hh | ind | |||||
1 | 1 | 1599 | 5792 | 534052 | Anji1 | >5000 |
2 | 2 | 259 | 920 | 534046 | Kamthi Khanapur | 500-1000 |
3 | 3 | 3 | 6 | 534049 | Sewa | <500 |
4 | 4 | 229 | 744 | 534045 | Chaka Majara | 500-1000 |
5 | 5 | 284 | 1071 | 534051 | Pavnur | 1000-2000 |
6 | 6 | 570 | 1990 | 534054 | Mandawa | 1000-2000 |
7 | 7 | 237 | 779 | 534055 | Pulai | 500-1000 |
8 | 8 | 150 | 524 | 534056 | Peth | 500-1000 |
9 | 9 | 193 | 700 | 534057 | Borgaon (Sawali) | 500-1000 |
10 | 10 | 133 | 462 | 534060 | Borgaon (Nandora) | <500 |
Source: Wave 1, Sevagram HDSS |
||||||
1 Large Village |
map_data %>%
head(n = 10) %>%
gt() %>%
tab_header(title = md("**Sevagram HDSS**"),
subtitle = "Population Details") %>%
tab_source_note(source_note = md("**Source:** Wave 1, Sevagram HDSS")) %>%
tab_footnote(footnote = "Large Village",
locations = cells_body(columns = description_english,
rows = ind > 5000)) %>%
tab_spanner(label = "Population details",
columns = c(hh, ind)) %>%
cols_hide(c(X, village, census_id, popcat))
Sevagram HDSS |
||
Population Details | ||
Population details | description_english | |
---|---|---|
hh | ind | |
1599 | 5792 | Anji1 |
259 | 920 | Kamthi Khanapur |
3 | 6 | Sewa |
229 | 744 | Chaka Majara |
284 | 1071 | Pavnur |
570 | 1990 | Mandawa |
237 | 779 | Pulai |
150 | 524 | Peth |
193 | 700 | Borgaon (Sawali) |
133 | 462 | Borgaon (Nandora) |
Source: Wave 1, Sevagram HDSS |
||
1 Large Village |
map_data %>%
head(n = 10) %>%
gt() %>%
tab_header(title = md("**Sevagram HDSS**"),
subtitle = "Population Details") %>%
tab_source_note(source_note = md("**Source:** Wave 1, Sevagram HDSS")) %>%
tab_footnote(footnote = "Large Village",
locations = cells_body(columns = description_english,
rows = ind > 5000)) %>%
tab_spanner(label = "Population details",
columns = c(hh, ind)) %>%
cols_hide(c(X, village, census_id, popcat)) %>%
cols_move_to_start(description_english)
Sevagram HDSS |
||
Population Details | ||
description_english | Population details | |
---|---|---|
hh | ind | |
Anji1 | 1599 | 5792 |
Kamthi Khanapur | 259 | 920 |
Sewa | 3 | 6 |
Chaka Majara | 229 | 744 |
Pavnur | 284 | 1071 |
Mandawa | 570 | 1990 |
Pulai | 237 | 779 |
Peth | 150 | 524 |
Borgaon (Sawali) | 193 | 700 |
Borgaon (Nandora) | 133 | 462 |
Source: Wave 1, Sevagram HDSS |
||
1 Large Village |
map_data %>%
head(n = 10) %>%
gt() %>%
tab_header(title = md("**Sevagram HDSS**"),
subtitle = "Population Details") %>%
tab_source_note(source_note = md("**Source:** Wave 1, Sevagram HDSS")) %>%
tab_footnote(footnote = "Large Village",
locations = cells_body(columns = description_english,
rows = ind > 5000)) %>%
tab_spanner(label = "Population details",
columns = c(hh, ind)) %>%
cols_hide(c(X, village, census_id, popcat)) %>%
cols_move_to_start(description_english) %>%
cols_label(description_english = "Village",
hh = "Households",
ind = "Population")
Sevagram HDSS |
||
Population Details | ||
Village | Population details | |
---|---|---|
Households | Population | |
Anji1 | 1599 | 5792 |
Kamthi Khanapur | 259 | 920 |
Sewa | 3 | 6 |
Chaka Majara | 229 | 744 |
Pavnur | 284 | 1071 |
Mandawa | 570 | 1990 |
Pulai | 237 | 779 |
Peth | 150 | 524 |
Borgaon (Sawali) | 193 | 700 |
Borgaon (Nandora) | 133 | 462 |
Source: Wave 1, Sevagram HDSS |
||
1 Large Village |
map_data %>%
head(n = 10) %>%
gt() %>%
tab_header(title = md("**Sevagram HDSS**"),
subtitle = "Population Details") %>%
tab_source_note(source_note = md("**Source:** Wave 1, Sevagram HDSS")) %>%
tab_footnote(footnote = "Large Village",
locations = cells_body(columns = description_english,
rows = ind > 5000)) %>%
tab_spanner(label = "Population details",
columns = c(hh, ind)) %>%
cols_hide(c(X, village, census_id, popcat)) %>%
cols_move_to_start(description_english) %>%
cols_label(description_english = "Village",
hh = "Households",
ind = "Population") %>%
tab_style(style = list(cell_fill(color = "green")),
locations = cells_body(columns = hh,
row = hh > 1000)) %>%
tab_style(style = list(cell_fill(color = "red")),
locations = cells_body(columns = ind,
row = ind < 500))
Sevagram HDSS |
||
Population Details | ||
Village | Population details | |
---|---|---|
Households | Population | |
Anji1 | 1599 | 5792 |
Kamthi Khanapur | 259 | 920 |
Sewa | 3 | 6 |
Chaka Majara | 229 | 744 |
Pavnur | 284 | 1071 |
Mandawa | 570 | 1990 |
Pulai | 237 | 779 |
Peth | 150 | 524 |
Borgaon (Sawali) | 193 | 700 |
Borgaon (Nandora) | 133 | 462 |
Source: Wave 1, Sevagram HDSS |
||
1 Large Village |