0
Ich habe ein Diagramm Ich möchte eine weitere Ebene hinzufügen Th Diagramm ist unten. Ich möchte eine andere Polardiagramm überlagern, um zu sehen, dass die Zahlen "zusammenpassen"R ggplot2: Hinzufügen eines weiteren Geoms zu coord_polar
In dem Beispiel unten habe ich das Diagramm für eine Spezies des Iris-Datasets erstellen. Ich möchte eine andere Handlung von einer anderen Spezies für Ihre Zeit
Sie Overlay Viele
library(ggplot2)
library(dplyr)
mydf <- iris
plot.data <- tidyr::gather(mydf,key = attribute ,value = avg_score, Sepal.Length:Petal.Width)
plot.data <- plot.data %>%
filter(Species == 'setosa') %>%
group_by(attribute) %>%
summarise(attr_mean = mean(avg_score))
ggplot(plot.data, aes(x=attribute, y = attr_mean, col = attribute)) +
geom_bar(stat = "identity", fill = 'white') +
coord_polar(theta = "x") +
theme_bw()
Thank you so much. Das ist sehr schlau –