[R] ggplot 3-dimensions

sibyiie@stoeckii m@iii@g oii gmx@ch sibyiie@stoeckii m@iii@g oii gmx@ch
Sat Dec 16 12:16:01 CET 2023


Dear R-user

Does anybody now, if ggplot allows to use two x-axis including two
dimensions (similar to excel plot (picture 1 in the pdf attachmet). If yes,
how should I adapt my code? The parameters are presented in the input file
(attachment: Input).

Fig2b = read.delim("BFF_Fig-2b.txt", na.strings="NA")
names(Fig2b)
head(Fig2b)
summary(Fig2b)
str(Fig2b)
Fig2b$Aspekt<-factor(Fig2b$Aspekt, levels=(c("Voegel", "Kleinsaeuger",
"Schnecken", "Regenwuermer_Asseln", "Pilze")))

### Figure 2b
  ggplot(Fig2b,aes(Aspekt,Wert,fill=Effekt))+
    geom_bar(stat="identity",position='fill')+
    scale_y_continuous(limits=c(0,14), expand=c(0,0))+
    labs(x="", y="Anzahl Studien pro Effekt")

Kind regards
Sibylle


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Picture1.pdf
Type: application/pdf
Size: 161275 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20231216/d0705931/attachment.pdf>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Input.pdf
Type: application/pdf
Size: 70289 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20231216/d0705931/attachment-0001.pdf>


More information about the R-help mailing list