Just out of curiosity (and I hope that my question does not confuse those who intuitively understood the par(new=TRUE) statement right in the beginning): I would like to know whether beginners (learning R) had the same difficulty as I had: Intuitively I thought that par(new=TRUE) would draw a new plot (and not into an already existing plot) and that par(new=FALSE) would not draw a new plot but draw into an already existing plot - opposed to what the par(new=TRUE) statement actually does. (It would be interesting to receive an answer also from those who meanwhile reached an expert status in working with the R syntax). Perhaps my confusion is due to the fact that I am a trained right-handed that really is a left-handed (those people tend to mistake contrasts). If there are a lot of people having this difficulty, I would like to know why the decision was made to define the mode of action of the par(new=TRUE) statement as it is now. Perhaps that helps me to understand better the way programmers tend to think. ************************************************* Dr. Dirk Enzmann Institute of Criminal Sciences Dept. of Criminology Schlueterstr. 28 D-20146 Hamburg Germany phone: +49-040-42838.7498 (office) +49-040-42838.4591 (Billon) fax: +49-040-42838.2344 email: dirk.enzmann at jura.uni-hamburg.de www: http://www2.jura.uni-hamburg.de/instkrim/kriminologie/Mitarbeiter/Enzmann/Enzmann.html
Dirk Enzmann <dirk.enzmann at jura.uni-hamburg.de> writes:> Just out of curiosity (and I hope that my question does not confuse > those who intuitively understood the par(new=TRUE) statement right in > the beginning): > > I would like to know whether beginners (learning R) had the same > difficulty as I had: Intuitively I thought that par(new=TRUE) would > draw a new plot (and not into an already existing plot) and that > par(new=FALSE) would not draw a new plot but draw into an already > existing plot - opposed to what the par(new=TRUE) statement actually > does. (It would be interesting to receive an answer also from those > who meanwhile reached an expert status in working with the R syntax). > Perhaps my confusion is due to the fact that I am a trained > right-handed that really is a left-handed (those people tend to > mistake contrasts). > > If there are a lot of people having this difficulty, I would like to > know why the decision was made to define the mode of action of the > par(new=TRUE) statement as it is now. Perhaps that helps me to > understand better the way programmers tend to think.Well, internal consistency tends to get higher priority than people's intuition. We already had par("new") which reflects a variable that gets set TRUE when a new page is created, and set FALSE when a page is "dirtied". This controls whether things like plot() needs to "eject the paper" and start a new plot area, or whether it can just draw into the existing area. To write on top of an existing plot it is occasionally useful to pretend that the plot is new so you set the variable accordingly. Now, we could of course have set up the logic so that par("new") was TRUE whenever you were *not* at the beginning of a new plot. Or we could have arranged so that par("new"=FALSE) would set par("new) to be TRUE, but neither struck us a particularly good idea.... -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Dirk Enzmann wrote:> Just out of curiosity (and I hope that my question does not confuse > those who intuitively understood the par(new=TRUE) statement right in > the beginning): > > I would like to know whether beginners (learning R) had the same > difficulty as I had: Intuitively I thought that par(new=TRUE) would draw > a new plot (and not into an already existing plot) and that > par(new=FALSE) would not draw a new plot but draw into an already > existing plot - opposed to what the par(new=TRUE) statement actually > does. (It would be interesting to receive an answer also from those who > meanwhile reached an expert status in working with the R syntax). > Perhaps my confusion is due to the fact that I am a trained right-handed > that really is a left-handed (those people tend to mistake contrasts). > > If there are a lot of people having this difficulty, I would like to > know why the decision was made to define the mode of action of the > par(new=TRUE) statement as it is now. Perhaps that helps me to > understand better the way programmers tend to think.This has been defined ages ago in the blue book (maybe in the brown one, I don't have it handy), so no chance to redefine. It confuses several users, but ?par has the nice explaination: 'new: logical, defaulting to FALSE. If set to TRUE, the next high-level plotting command (actually plot.new) should not clean the frame before drawing "as if it was on a new device".' Uwe Ligges> ************************************************* > Dr. Dirk Enzmann > Institute of Criminal Sciences > Dept. of Criminology > Schlueterstr. 28 > D-20146 Hamburg > Germany > > phone: +49-040-42838.7498 (office) > +49-040-42838.4591 (Billon) > fax: +49-040-42838.2344 > email: dirk.enzmann at jura.uni-hamburg.de > www: > http://www2.jura.uni-hamburg.de/instkrim/kriminologie/Mitarbeiter/Enzmann/Enzmann.html > > > ______________________________________________ > 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
Apparently Analagous Threads
- skewness and kurtosis in e1071 correct?
- Problem with read.spss() and as.data.frame(), or: alternative to subset()?
- standardized random effects with ranef.lme()
- How to reply to a thread if receiving R-help mails in digest form
- using argument names (of indeterminate number) within a function