Hi I'd appreciate some help with plotting odds ratios. I want to rotate the labels on the x-axis by 45 degrees. The usual way of doing this, using text - e.g. text(1, par('usr')[3]-2.25..) - gives no result when the y-axis is a log scale. I guess this is because, as the par help says, for a logarithmic y-axis: y-limits will be 10 ^ par("usr")[3:4] Does anyone know a solution for this? The example below works well if log='y' is omitted. Thanks very much for your help Tim #Create plot with log-scale on the y-axis par(mar = c(7, 4, 4, 2) + 0.1) plot(1, type='n', bty='n', xlab="", ylab='Odds Ratio', xlim= c(0.5,4.5), ylim= c(0.75, 2), cex=2, xaxt='n', yaxt='n', cex.lab=1.3, log='y') # Line of unity segments(0,1,10,1, lwd=2, lty=2) #Estimates and confidence intervals points(c(1:4),c(1.1,1.32,1.14,1.36), pch=17, cex=1.5, col='blue') segments (c(1:4),c(0.93,1.11,0.94,1.15),c(1:4),c(1.3,1.58,1.37,1.61), col='blue', lwd=2) axis(1,c(1:4), labels= F) axis(2, at=seq(0.75,2, by=0.25), labels=seq(0.75,2, by=0.25), las=1) labels <- paste("Label", 1:4, sep = " ") text(1:4-0.25, par('usr')[3]-0.15, xpd=TRUE, labels=labels, adj=0.1, srt=45) mtext("Exposure", side=1, line=4.5, cex=1.5) [[alternative HTML version deleted]]
On 08/24/2010 11:44 AM, Tim Elwell-Sutton wrote:> Hi > > I'd appreciate some help with plotting odds ratios. I want to rotate the > labels on the x-axis by 45 degrees. > > The usual way of doing this, using text - e.g. text(1, par('usr')[3]-2.25..) > - gives no result when the y-axis is a log scale. > > I guess this is because, as the par help says, for a logarithmic y-axis: > y-limits will be 10 ^ par("usr")[3:4] >Hi Tim, If you know where to put the labels, try: library(plotrix) staxlab(1,at=...,labels=...,srt=45) Jim
Hi ALL I want to run a program on my office computer, but for some reason I have to run it later when I am not in the office anymore. Is there a way to do it? Can I run a program now but in the beginning I say that the rest should be run 3 hours later for example? Thanks a lot Leila
have a look at Sys.sleep(), i.e., you probably need Sys.sleep(3*3600) I hope it helps. Best, Dimitris On 8/24/2010 3:01 PM, l.mohammadikhankahdani wrote:> Hi ALL > > I want to run a program on my office computer, but for some reason I > have to run it later when I am not in the office anymore. > Is there a way to do it? Can I run a program now but in the beginning I > say that the rest should be run 3 hours later for example? > Thanks a lot > > Leila > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Dimitris Rizopoulos Assistant Professor Department of Biostatistics Erasmus University Medical Center Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands Tel: +31/(0)10/7043478 Fax: +31/(0)10/7043014