Re: [R] error while creating a simple graph

2017-06-20 Thread Rainer Krug
> On 20 Jun 2017, at 07:18, Yogesh Gupta wrote: > > Dear All, > > I am learning R so it's a very simple problem but I do not understand while > I am not able to generate a graph from two vectors. > > when I type this code, it generates a very nice graph. > > pdf("mygraph.pdf") >> attach(mtcar

Re: [R] error while creating a simple graph

2017-06-20 Thread Rui Barradas
Hello, You don't need dev.new, but you need to tell R that the plot is finished by calling dev.off after the plot command. Hope this helps, Rui Barradas Em 20-06-2017 06:18, Yogesh Gupta escreveu: Dear All, I am learning R so it's a very simple problem but I do not understand while I am no

Re: [R] error while creating a simple graph

2017-06-20 Thread PIKAL Petr
Hi Did you close pdf device by dev.off() ? Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Yogesh Gupta > Sent: Tuesday, June 20, 2017 7:18 AM > To: r-help@r-project.org > Subject: [R] error while creating a simple gra

[R] error while creating a simple graph

2017-06-20 Thread Yogesh Gupta
Dear All, I am learning R so it's a very simple problem but I do not understand while I am not able to generate a graph from two vectors. when I type this code, it generates a very nice graph. pdf("mygraph.pdf") > attach(mtcars) > plot(wt,mpg) > abline(lm(mpg~wt)) > title("Regreesion of mpg") >