Hello,  I am not having success in a simple task.  Using the effects package, I 
would like to add reference lines at probability values of 0.1 – 0.6 on a 
plot of the effects.  The plot command works, but following up with an abline 
command produces the message “plot .new has not been called yet”, and of 
course the reference lines were not added.

Looking through past R help lists, there was a similar request for help --- 
trying to add an abline but “got the error "plot.new  has not been called 
yet".

The help list reply was

“ ?abline: "This function adds one or more straight lines through the 
current plot.", i.e. the already existing *current plot*.

So plot your data (e.g. with plot(x, y)) before adding a regression line.”

I interpreted the above to suggest the following --- 

plot(allEffects(Clean.label),ask=FALSE, alternating = TRUE,
        ylab="Probability of Rating", xlab="City",main="Cleanliness Ratings by 
City",
        factor.names=FALSE, ticks=c(0.1,0.2,0.3,0.4,0.5,0.6))
abline(h=c(0.1,0.2,0.3,0.4,0.5,0.6))

Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : 
  plot.new has not been called yet

Less bothersome is the fact that the tick marks weren’t modified to 0.1, 0.2, 
0.3, etc. 

Further searching brought the panel.abline command to light, but that didn’t 
produce any results, not even an error message.

> plot(allEffects(Clean.label),ask=FALSE, alternating = TRUE,
+ ylab="Probability of Rating", xlab="City",main="Cleanliness Ratings by City",
+  factor.names=FALSE, ticks=c(0.1,0.2,0.3,0.4,0.5,0.6))

> panel.abline(h=c(0.1,0.2,0.3,0.4,0.5,0.6))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> sessionInfo()
R version 2.9.0 RC (2009-04-10 r48318) 
i386-pc-mingw32 

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United 
States.1252;LC_MONETARY=English_United 
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] tcltk     grid      stats     graphics  grDevices utils     datasets  
methods  
[9] base     

other attached packages:
[1] relimp_1.0-1     Rcmdr_1.4-9      car_1.2-13       effects_2.0-4   
[5] colorspace_1.0-0 nnet_7.2-46      MASS_7.2-46      lattice_0.17-22 

loaded via a namespace (and not attached):
[1] tools_2.9.0
Thank you for any advice. 
Paul

Paul Prew   ▪  Statistician
651-795-5942   ▪   fax 651-204-7504 
Ecolab Research Center   ▪  Mail Stop ESC-F4412-A 
655 Lone Oak Drive   ▪   Eagan, MN 55121-1560 



CONFIDENTIALITY NOTICE: 
This e-mail communication and any attachments may contain proprietary and 
privileged information for the use of the designated recipients named above. 
Any unauthorized review, use, disclosure or distribution is prohibited. 
If you are not the intended recipient, please contact the sender by reply 
e-mail and destroy all copies of the original message.


        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to