Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 每个月的方框图:重新排序_R_Ggplot2_Boxplot - Fatal编程技术网

R 每个月的方框图:重新排序

R 每个月的方框图:重新排序,r,ggplot2,boxplot,R,Ggplot2,Boxplot,我有一个名为MyData的数据框。假设它看起来像这样: GreekMonth <- c("Ir","Fe","Mr","Ar","Ma","In","Il","Au","Se","Ok","No","De") SomeValue <- c(rep

我有一个名为
MyData
的数据框。假设它看起来像这样:

GreekMonth <- c("Ir","Fe","Mr","Ar","Ma","In","Il","Au","Se","Ok","No","De")

SomeValue <- c(rep(c(1,3,5),4), rep(c(2,4,6),4), rep(c(7,8,9),4))

MyData <- data.frame(MONTHS=rep(GreekMonth,3), MY_VALUE=SomeValue)
GreekMonth您可以试试

MyBox + 
  geom_boxplot()+
  xlim(GreekMonth)
你可以试试

MyBox + 
  geom_boxplot()+
  xlim(GreekMonth)
MyBox2 <- ggplot(MyData, aes(x=MONTHS, y=MY_VALUE))

MyBox2 + geom_boxplot()
MyBox + 
  geom_boxplot()+
  xlim(GreekMonth)