Peter Lercher
2007-Jun-08 09:07 UTC
[R] overplots - fixing scientific vs normal notation in output
Moving from S-plus to R I encountered many great features and a much more stable system. Currently, I am left with 2 problems that are handled differently: 1) I did lots of "overplots" in S-Plus using par(new=T,xaxs='d',yaxs='d') to fix the axes ->What is the workaround in R ? 2) In S-Plus I could fix "scientific notation" or "normal notation" in output ->How can I handle this in R ? I found no fix in the documentation I am using R version 2.4.1 (2006-12-18) on Windows XP SR2 Peter Lercher, M.D., M.P.H., Assoc Prof
John Kane
2007-Jun-08 14:48 UTC
[R] overplots - fixing scientific vs normal notation in output
--- Peter Lercher <Peter.Lercher at i-med.ac.at> wrote:> Moving from S-plus to R I encountered many great > features and a much > more stable system. > Currently, I am left with 2 problems that are > handled differently: > > 1) I did lots of "overplots" in S-Plus using > par(new=T,xaxs='d',yaxs='d') to fix the axes > ->What is the workaround in R ?What does S=Plus do here?> > 2) In S-Plus I could fix "scientific notation" or > "normal notation" in output > ->How can I handle this in R ? > I found no fix in the documentation?format() maybe?> > I am using R version 2.4.1 (2006-12-18) on Windows > XP SR2 > > > Peter Lercher, M.D., M.P.H., Assoc Prof > > ______________________________________________ > 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 > and provide commented, minimal, self-contained, > reproducible code. >
Greg Snow
2007-Jun-08 15:33 UTC
[R] overplots - fixing scientific vs normal notation in output
Peter Lercher wrote:> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Peter Lercher > Sent: Friday, June 08, 2007 3:07 AM > To: r-help at stat.math.ethz.ch > Subject: [R] overplots - fixing scientific vs normal notation > in output > > Moving from S-plus to R I encountered many great features and > a much more stable system. > Currently, I am left with 2 problems that are handled differently: > > 1) I did lots of "overplots" in S-Plus using > par(new=T,xaxs='d',yaxs='d') to fix the axes > ->What is the workaround in R ?Since you are using the same axes, do you really need to do the overplotting instead of just using lines/points to add to the plot? R has not implemented xaxs='d', so on your additional plots, just specify xlim and/or ylim directly. There are a couple of ways to do this. First, find the range of values from all of your plots then use this as the argument to xlim and ylim for each plot. Second, create the first plot then use par('usr') to find what the limits of the coordinates are, then use these values for xlim/ylim in further plots (using xaxs/yaxs='i' so the extra 4% is not added). Third, there are probably other ways, but the above should get you started.> 2) In S-Plus I could fix "scientific notation" or "normal > notation" in output > ->How can I handle this in R ? > I found no fix in the documentationLook at options('scipen'), this is not exactly fixing it like S-PLUS, but could solve most your problems.> > I am using R version 2.4.1 (2006-12-18) on Windows XP SR2 > > > Peter Lercher, M.D., M.P.H., Assoc Prof >Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at intermountainmail.org (801) 408-8111