[R] Dates labels on axes in xyplot

2005-02-08 Thread Denham Robert
I am a bit confused about how to get the format of the labels in xyplot to show as dates rather than the numeric value. e.g., x - as.Date(c(20/01/2001,20/02/2003,21/06/2004),%d/%m/%Y) y - c(1,2,3) plot(y~x) #produces formatted labels xyplot(y~x) #doesn't give formatted x labels

[R] Sub with and without perl=TRUE

2005-02-13 Thread Denham Robert
I have a problem doing substitution using sub and perl=TRUE when the elements of x have fewer characters than the replacement string. Let me show you what I mean: sub(m,billy,m) [1] billy But using perl=TRUE, I can only return a result as long as my x: sub(m,billy,m,perl=TRUE) [1] b