此代码将X变量排序为< 8,10-12,12-20,20 +,然后是8-10。 为什么" 8-10"乱了?谢谢。
=RADIANS(brng)
`where brng is a named cells holding an angle measured in degrees
答案 0 :(得分:0)
您应该使用有序的factor
:
mylevels <-c("<8", "8-10","10-12", "12-20","20+")
tst1 <- data.frame(
len = c(1.00, 1.038219, 1.040130, 1.078980, 1.186618 ),
pm25=factor(mylevels, levels=mylevels, ordered =T))
plottst1 <- ggplot(tst1, aes(x=pm25, y=len))
plottst1