[R] plot.new?

Jan Goebel jgoebel at diw.de
Thu Aug 26 17:44:34 CEST 2004


>From help(abline):

Examples:

     data(cars)
     z <- lm(dist ~ speed, data = cars)
     plot(cars)
     abline(z)


You first have to create a plot to which you can add a line.

jan

On Thu, 26 Aug 2004, Filippo Biscarini wrote:

> Hi all,
> 
> I am just beginning to use R and encountered a problem in trying to draw a
> regression line using the command "abline(coef(var)" and similar ones but
> got the error "plot.new  has not been called yet". Does anybody know how can
> I call plot.new? Is this an additional package to be found somewhere on the
> web? Is it a functionality that I just have to "activate" somehow?
> 
> I am using R both on windows and on Linux and get the same error message
> when using those drawing functions.
> 
> Thank you,
> 
> Filippo Biscarini
>   ****************************
>   Filippo Biscarini,
>   Research and Development
>   ANAFI (Italian Holstein Association)
>   Via Bergamo, 292
>   26100, Cremona, Italy
> 
>   tel: +39.0372.474234
> 
>   *****************************
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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

-- 
+-----------------------------------------
 Jan Goebel 
 j g o e b e l @ d i w . d e

 DIW Berlin 
 German Socio-Economic Panel Study (GSOEP) 
 Königin-Luise-Str. 5
 D-14195 Berlin -- Germany --
 phone: 49 30 89789-377
+-----------------------------------------




More information about the R-help mailing list