[R] bi-directional bar chart with a central axis
Sabatier, Jennifer F. (CDC/DDPHSIS/CGH/DGHP)
|vv9 @end|ng |rom cdc@gov
Wed Sep 18 00:36:32 CEST 2019
Oh, I guess I just wasn't thinking of them as population pyramids since the variables A-M are actually responses to unrelated survey questions and not age bins. But that's silo'd thinking because why would that matter?
Thanks for the brain nudge. I'll check out the plotrix link.
From: David Winsemius <dwinsemius using comcast.net>
Sent: Tuesday, September 17, 2019 6:32 PM
To: Sabatier, Jennifer F. (CDC/DDPHSIS/CGH/DGHP) <fvv9 using cdc.gov>; r-help using r-project.org
Subject: Re: [R] bi-directional bar chart with a central axis
On 9/17/19 3:14 PM, Sabatier, Jennifer F. (CDC/DDPHSIS/CGH/DGHP) via R-help wrote:
> Hi R-help,
> I have this data:
> my.dta <-data.frame(matrix(c(
> 26.3, 21.4,
> 20.1, 13.4,
> 7.9, 3.9,
> 16.5, 14.6,
> 5.3, 3.6,
> 38.6, 25.6,
> 34.4, 21.6,
> 77.4, 79.5,
> 58.2, 56.1,
> 80.5, 84,
> 37.7, 31.9,
> 19.9, 28.1,
> 6.2, 5.9
> ), nrow=13, ncol=2, byrow=T,
> dimnames=list(c('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M'),
> c("Males", "Females"))
> I want to make a graph that looks like this:
I suppose it helps to know that these are called "pyramid charts"
because of their common use in demographic circles for displaying comparative population structures of men and women ("population pyramids").
Also look in the plotrix package since I seem to remember that it has
one nicely documented and illustrated.
> Any help would be highly appreciated!
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help