[R] Adding Year-Month-Day to X axis

Gregory Coats gregco@t@ @ending from me@com
Sat May 5 20:14:15 CEST 2018


I am using R 3.5.0 for Mac OS X.
Issuing these two commands yields the expected plot.
y_duration <- c (301.59050,  387.35700,  365.64366,  317.26150,  321.71883,  342.44950,  318.95350,  322.33233,  330.60333,  428.99516,  297.82066)
plot (y_duration, type="l”)

Adding Year-Month-Day values for the x axis, and then calling plot (x,y), yields a bizarre plot. Apparently, R does not understand my Year-Month-Day values.
x_yyyymmdd <- c (2018-04-25, 2018-04-26, 2018-04-27, 2018-04-28, 2018-04-29, 2018-04-30, 2018-05-01, 2018-05-02, 2018-05-03, 2018-05-04, 2018-05-05)
plot (x_yyyymmdd, y_duration, type="l")

I would be enormously appreciative of your guidance.
Greg Coats
Virginia, USA
	[[alternative HTML version deleted]]



More information about the R-help mailing list