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]]
>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 +-----------------------------------------
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??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. Uwe Ligges> 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