Dear R-users,
I'm struggling with APA formatted two way BAR-charts according to apa-style
i should have the legend in the background of my plot (so above the bars and
not beside the picture/plot itself) and the background should be completely
white without gridlines or what so ever. Could any one give me a hint or
solution? See Below for my commands
thank you so much,
Benjamin Telkamp (Email: inzichtelijk@gmail.com, The Netherlands)
these are the commands used so far which just didn't give me what i wanted
library(ggplot2)
library(foreign)
install.packages("Hmisc")
DATA1 <- read.spss(file=DATA1, use.value.labels=TRUE, to.data.frame=TRUE)
Bar_PD <- ggplot(DATA1, aes(Age_group, IRI_PD ))
Bar_PD + stat_summary(fun.y = mean, geom = "bar", fill =
"Purple") +
stat_summary(fun.data = mean_cl_normal, geom = "errorbar", width =
0.2) +
labs (x = "Leeftijdsgroep", y = "IRI PD") +
theme(plot.background element_rect(colour= "White"))
______________________________________
If you reply to this email, your message will be added to the discussion below:
http://r.789695.n4.nabble.com/APA-two-way-bar-chart-tp4683046.html
This email was sent by Benjamin Telkamp (via Nabble)
To receive all replies by email, subscribe to this discussion:
http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=subscribe_by_code&node=4683046&code=ci1oZWxwQHItcHJvamVjdC5vcmd8NDY4MzA0NnwtNzg0MjM1NTA4
[[alternative HTML version deleted]]
On 01/04/2014 03:08 AM, Benjamin Telkamp [via R] wrote:> Dear R-users, > > I'm struggling with APA formatted two way BAR-charts according to apa-style > i should have the legend in the background of my plot (so above the bars and > not beside the picture/plot itself) and the background should be completely > white without gridlines or what so ever. Could any one give me a hint or > solution? See Below for my commands > > thank you so much, > > Benjamin Telkamp (Email: inzichtelijk at gmail.com, The Netherlands) > > these are the commands used so far which just didn't give me what i wanted > > library(ggplot2) > library(foreign) > install.packages("Hmisc") > DATA1<- read.spss(file=DATA1, use.value.labels=TRUE, to.data.frame=TRUE) > Bar_PD<- ggplot(DATA1, aes(Age_group, IRI_PD )) > Bar_PD + stat_summary(fun.y = mean, geom = "bar", fill = "Purple") + > stat_summary(fun.data = mean_cl_normal, geom = "errorbar", width = 0.2) + > labs (x = "Leeftijdsgroep", y = "IRI PD") + theme(plot.background > element_rect(colour= "White")) >Hi Benjamin, I'm not sure what you mean by a two way bar chart. If it is a grouped barplot in which the members of each group are defined by the levels of one discrete variable and the groups are defined by another discrete variable, the basic "barplot" function with an added legend should do what you want. Can you give an example such as an image on the internet that shows what you want? Jim