以下是一些示例代码。没有错误,但是我想知道我会怎么做,以便它根据month1值从左到右显示数据。最左边是201812(2018年12月),最右边是202011(2020年11月)。
#Data generation
Month1 <- c(201812,20191,20192,20193,20194,20195,20196,
20197,20198,20199,201910,201911,201912,20201
,20202,20203,20204,20205,20206,20207
,20208,20209,202010,202011)
annualjobgrowth<- c(44400,46000,42600,40500,42800,40500,36000,
34000,32300,29900,21900,24500,21000,
23300,16000,-6200,-275600,-249500,-149200,
-136500,-129900,-122800,-113900,-109500)
Rate <-
c(3.3,3.4,3.1,3.0,3.1,2.9,2.6,2.5,2.3,2.1,1.6,1.7,1.5,1.7,1.1,-0.4,
-19.5,-17.6,-10.5,-9.6,-9.1,-8.6,-8.0,-7.7)
cesyoy <- data.frame(Month1,annualjobgrowth, Rate)
#Chart
library(ggplot2)
ceschart <- ggplot() + geom_col(data = cesyoy, aes(x = Month1, y = annualjobgrowth))
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句