Ich möchte meine facet_plot
plot auf zwei Parameter zur gleichen Zeit bestellen. Ich habe einen Blick here und here aber ich verstehe nicht, wie ich mit meinen zwei Achsen use
und es.type
zur gleichen Zeit umgehen.um ein facet_grid oder facet_wrap grid nach modalität in ggplot2 zu bestellen
library(ggplot2)
my.df <- data.frame(site = sample(c("place1","place2"), 20, replace = T), value = sample(1:10,20,replace = T),
use = sample(c("medic","pharma","foodS","forage"), 5, replace = T), es.type = sample(c("plante","cereal","sol","sun"), 5, replace = T))
so my.df
können wie:
site value use es.type
1 place2 5 medic sol
2 place2 2 forage sun
3 place2 2 medic plante
4 place2 8 pharma plante
5 place2 8 foodS cereal
6 place1 9 medic sol
7 place1 6 forage sun
8 place2 10 medic plante
9 place1 8 pharma plante
10 place1 10 foodS cereal
11 place1 7 medic sol
12 place1 3 forage sun
13 place1 5 medic plante
14 place2 7 pharma plante
15 place1 2 foodS cereal
16 place1 9 medic sol
17 place2 1 forage sun
18 place1 2 medic plante
19 place1 8 pharma plante
20 place2 8 foodS cereal
mein Grundstück
ggplot(data = my.df)+
geom_bar(aes(x = site, y = value, fill = site), stat="identity")+
facet_wrap(use~es.type)+
theme(axis.text.x=element_blank(),
axis.ticks.x=element_blank())
ich facet
nachbestellen möchte, ist und die maximale Kombination zuerst haben.
"max Kombination" ist mehrdeutig. Meinst du die Kombination von 'use' und' es.type'? Eine der Seiten oder beides? Vielleicht sagen Sie uns, in welcher Reihenfolge die Facetten sein sollten. – Axeman
Entschuldigung für diese Mehrdeutigkeit. Ich möchte mit 'use' und' es.type' spielen und habe das Maximum an beiden Werten in der ersten Position. – delaye