jun.zang at jpmorgan.com
2006-May-31 19:13 UTC
[R] plot problem in version 2.3.0 with dates as x
Hi, I have some old programs running well for older versions 2.2.0 and 2.1.1, but cannot run under 2.3.0. The problem is in plot with dates as x: library(survival) test <- data.frame( x = c(1:20), date = as.date(1:20)) plot(test$date, test$x) --------------------------------------------------------- Error in plot.window(xlim, ylim, log, asp, ...) : "log=" specification must be character Is this a bug in v2.3.0? Thanks, Jun Zang Fixed Income Research JP Morgan Asset Management This communication is for informational purposes only. It is...{{dropped}}
Note, this is about plot.date (not dates, a different class) in the contributed survival package, not R 2.3.0. You need to use log="" as plot.date incorrectly uses as its default log=NULL. Please see the posting guide about how to report a problem in a contributed package. On Wed, 31 May 2006, jun.zang at jpmorgan.com wrote:> Hi, I have some old programs running well for older versions 2.2.0 and > 2.1.1, but cannot run under 2.3.0. The problem is in plot with dates as x: > > library(survival) > test <- data.frame( x = c(1:20), date = as.date(1:20)) > plot(test$date, test$x) > --------------------------------------------------------- > Error in plot.window(xlim, ylim, log, asp, ...) : > "log=" specification must be character > > Is this a bug in v2.3.0? > > Thanks, > > Jun Zang > Fixed Income Research > JP Morgan Asset Management > > > > This communication is for informational purposes only. It is...{{dropped}} > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Using R 2.2.1 under Windows, I have developed a very busy Trellis dot plot with 2 columns of 7 panels and dates on the x axes. Is there a way to print the date labels vertically instead of horizontally so I can include more on the graph? Also, can I take some control over which dates are printed (e.g. 1,4,7,10,13)? Nothing stood out to me on trellis.par.get(). Thanks for the help. Steve Miller
See the scales section in the help page for xyplot. This gives you control over the number, location, and labeling of ticks as well as the rotation of the labels. Steve Miller wrote:> Using R 2.2.1 under Windows, I have developed a very busy Trellis dot plot > with 2 columns of 7 panels and dates on the x axes. Is there a way to print > the date labels vertically instead of horizontally so I can include more on > the graph? Also, can I take some control over which dates are printed (e.g. > 1,4,7,10,13)? Nothing stood out to me on trellis.par.get(). > > Thanks for the help. > > Steve Miller > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 512-0171 (M, W, F) fax: (917) 438-0894