R 将镶嵌面网格结构与镶嵌面包裹轴相结合

R 将镶嵌面网格结构与镶嵌面包裹轴相结合,r,ggplot2,facet,R,Ggplot2,Facet,我有类似于此示例的数据(具有更大的值范围) 日和的可能重复项。 Day <- rep(1:5, times=6) Fruit <- rep(c("Apple", "Banana", "Blueberry"), times = c(15,10,5)) Colour <- rep( c("Yellow","Red", "Green", "Yellow

我有类似于此示例的数据(具有更大的值范围)

日和的可能重复项。
Day <- rep(1:5, times=6) 
Fruit <- rep(c("Apple", "Banana", "Blueberry"), times = c(15,10,5)) 
Colour <- rep( c("Yellow","Red", "Green", "Yellow","Blue", "Purple"), each=5)
Values <-rep(c(3,4,5,6,7,4,5,6,7,8,5,6,7,8,9), times=2) 
SorS <- rep("Sweet", times=30) 
sweet <-data.frame(Day, Fruit, Colour, Values, SorS) 
SorS <- rep("Sour", times = 30) 
sour <- data.frame(Day, Fruit, Colour, Values, SorS) 
sour$Values <- sour$Values*10 
sour$Day <- sour$Day*10 
Data <- rbind(sweet, sour)
ForPlot <-  ggplot(Data, aes(Day, Values), fill=Colour)

    ForPlot+
      geom_point(aes(fill=Colour))+
      ggtitle("Fruity Colours")+
      ylab("Values") + xlab("Day") +
      facet_wrap(SorS~Fruit,  scales= "free", ncol=3)
ForPlot <-  ggplot(Data, aes(Day, Values), fill=Colour)

ForPlot+
  geom_point(aes(fill=Colour))+
  ggtitle("Fruity Colours")+
  ylab("Values") + xlab("Day") +
  facet_rep_grid(SorS~Fruit,  scales= "free", switch="y")