我正在尝试沿 x 轴绘制一些带有月份数据的数据。不幸的是,月份显示为小数。有任何想法吗?
library(zoo) # Requires the zoo library.
theMonths <- as.yearmon(c( "Mar 2011", "Apr 2011", "May 2011", "Jun 2011", "Jul 2011", "Aug 2011", "Sep 2011", "Oct 2011", "Nov 2011", "Dec 2011", "Jan 2012", "Feb 2012"))
x <- c(1:12)
plot(theMonths,x,axes=FALSE)
axis(1,theMonths)
# Why do the dates appear on the axis as decimals?