Re: [R] Displayed Date Format in Plot Title.

2012-04-13 Thread R. Michael Weylandt
as.Date() attemps to coerce a character string to a date where you specify the input format -- if you want to specify an output format, you need ?strftime [str + f + time == string format time] E.g., titleDate <- as.Date("2011-05-03", format = "%Y-%m-%d") plot(1:10, main = strftime(titleDate, "%

[R] Displayed Date Format in Plot Title.

2012-04-13 Thread Sam Albers
Hello all, I can't seem to figure out how to format a date as a title. I have something like this: plot(x=1:10, y=runif(10,1,18), main=paste(as.Date("2011-05-03", format="%Y-%m-%d"))) ## When I would really like this plot(x=1:10, y=runif(10,1,18), main=paste("May-03-2011")) ## I thought to try