x軸に沿って月データを含むデータをプロットしようとしています。残念ながら、その月は小数として現れています。何か案は?Rプロットの小数点として表示される日付
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?
彼が 'むしろaxis.yearmon' – James
@James'よりaxis'を呼び出していることが表示されます:あなたはyearmon分類対象と 'axis'呼び出すと、それが派遣します'axis.yearmon' ....それはRの方法です –
@DWinそれは一般的にどのように動作するのか理解していますが、' axis(1、theMonths) 'を 'zoo :::と比較すると、 axis.yearmon(1、theMonths) ' – James