Example figure link: http://www.nature.com/nature/journal/v528/n7580_supp_custom/fig_tab/nature16039_F5.html
I want my data to look as the figurein the link using ggplot
. The "PCR+ RDT+" group should be above the x-axis grouped by age groups (called "variable" in the data set). Study site and "PCR+ RDT-" should be below the x-axis in a similar way. My Study sites should replace the prevalence groups of the figure. Values are the percentages calculated.
This is my data.
dat <- read.table(sep = ' ', text =
'Study_Site Status variable value
AJ PCR+RDT+ "0-1 year" 0.00
AJ PCR+RDT- "0-1 year" 0.00
KA PCR+RDT+ "0-1 year" 0.00
KA PCR+RDT- "0-1 year" 0.00
KI PCR+RDT+ "0-1 year" 0.00
KI PCR+RDT- "0-1 year" 0.88
WE PCR+RDT+ "0-1 year" 0.00
WE PCR+RDT- "0-1 year" 0.00
AJ PCR+RDT+ "1-5 years" 5.69
AJ PCR+RDT- "1-5 years" 2.44
KA PCR+RDT+ "1-5 years" 0.00
KA PCR+RDT- "1-5 years" 0.22
KI PCR+RDT+ "1-5 years" 0.00
KI PCR+RDT- "1-5 years" 2.65
WE PCR+RDT+ "1-5 years" 3.19
WE PCR+RDT- "1-5 years" 2.13', header = TRUE)