Re: [R] An empty grey diagram

2010-11-22 Thread Martin Maechler
 Stephen Liu sati...@yahoo.com
 on Sat, 20 Nov 2010 00:12:07 -0800 (PST) writes:

 Hi Josh and David,
 Problem solved.

 Both following steps work.

 1)
 ToothGrowth
 attach(ToothGrowth)
 plot(dose,len)   # this step is needed.  Don't close the diagram.  
Otherwise 
 following command won't work.

 matrics=lm(len~dose)
 abline(matrics)

 Graph displayed

 2)
 ToothGrowth
 attach(ToothGrowth)
 plot(dose, len)   # this step is needed.  Don't close the diagram.  
Otherwise 
 following command won't work.

 abline(lm(len ~ dose, data = ToothGrowth))

 Graph displayed

Well, it is  *VERY BAD*  style and error-prone practice  nowadays,
to attach a data set.
 [The only thing to attach() are  save()d data *files*;
  there it's often tidier to attach() instead of to load() ...]


I have not followed all the things you tried .. or did not try.

A much better way of achieving the above (and yes; *never* close
  the graphics window within these) should be

 plot (len ~ dose, data=ToothGrowth)
 abline(lm(len ~ dose, data=ToothGrowth))

and you can see {if you use a fixed-width font in your e-mail,
 it springs into your eyes}
how nicely the formula notation of graphics alings with
the same in models.

If the above two simple lines do not work correctly,
then your R environment is broken in some way,
and maybe first doing  
rm(list = ls())
may help.

Martin Maechler, 
ETH Zurich and R Core Team


 B.R.
 Stephen L


 - Original Message 
 From: Joshua Wiley jwiley.ps...@gmail.com
 To: Stephen Liu sati...@yahoo.com
 Cc: r-help@r-project.org
 Sent: Sat, November 20, 2010 1:39:45 PM
 Subject: Re: [R] An empty grey diagram

 On Fri, Nov 19, 2010 at 9:35 PM, Stephen Liu sati...@yahoo.com wrote:
 Hi David,
 
 
 What happens when you follow the directions... i.e. type:
 plot.new()#???
 
 abline(lm(len ~ dose, data = ToothGrowth))
 plot.new()
 
 The grey background changes to white, still an empty graph

 You cannot just use abline() on an empty graphic (well, you can but
 you get an empty graph).  Please actually run my code, it will create
 a scatter plot, then add a line.  Do not close the graphic device in
 between.

 with(ToothGrowth, plot(dose, len))
 abline(lm(len ~ dose, data = ToothGrowth))




 __
 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.

__
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.


Re: [R] An empty grey diagram

2010-11-20 Thread Stephen Liu
Hi Josh and David,


Problem solved.

Both following steps work.

1)
 ToothGrowth
 attach(ToothGrowth)
 plot(dose,len)   # this step is needed.  Don't close the diagram.  Otherwise 
following command won't work.

 matrics=lm(len~dose)
 abline(matrics)

Graph displayed

2)
 ToothGrowth
 attach(ToothGrowth)
 plot(dose, len)   # this step is needed.  Don't close the diagram.  Otherwise 
following command won't work.

 abline(lm(len ~ dose, data = ToothGrowth))

Graph displayed


B.R.
Stephen L


- Original Message 
From: Joshua Wiley jwiley.ps...@gmail.com
To: Stephen Liu sati...@yahoo.com
Cc: r-help@r-project.org
Sent: Sat, November 20, 2010 1:39:45 PM
Subject: Re: [R] An empty grey diagram

On Fri, Nov 19, 2010 at 9:35 PM, Stephen Liu sati...@yahoo.com wrote:
 Hi David,


 What happens when you follow the directions... i.e. type:
 plot.new()#???

 abline(lm(len ~ dose, data = ToothGrowth))
 plot.new()

 The grey background changes to white, still an empty graph

You cannot just use abline() on an empty graphic (well, you can but
you get an empty graph).  Please actually run my code, it will create
a scatter plot, then add a line.  Do not close the graphic device in
between.

with(ToothGrowth, plot(dose, len))
abline(lm(len ~ dose, data = ToothGrowth))




__
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.


[R] An empty grey diagram

2010-11-19 Thread Stephen Liu
Hi folks,

Win7 64bit
R 1.12.0

I run following command on R:-

 ToothGrowth
 attach(ToothGrowth)
 plot(dose,len)
 matrics=lm(len~dose)

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

Only a grey diagram is displayed without content


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

With the same result.


Pls advise what does it mean?  How to rectify it?  TIA


B.R.
Stephen L




__
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.


Re: [R] An empty grey diagram

2010-11-19 Thread Joshua Wiley
Hi Stephen,

Please try:

with(ToothGrowth, plot(dose, len))
abline(lm(len ~ dose, data = ToothGrowth))


Cheers,

Josh

On Fri, Nov 19, 2010 at 6:44 PM, Stephen Liu sati...@yahoo.com wrote:
 Hi folks,

 Win7 64bit
 R 1.12.0

 I run following command on R:-

 ToothGrowth
 attach(ToothGrowth)
 plot(dose,len)
 matrics=lm(len~dose)

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

 Only a grey diagram is displayed without content


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

 With the same result.


 Pls advise what does it mean?  How to rectify it?  TIA


 B.R.
 Stephen L




 __
 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.




-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/

__
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.


Re: [R] An empty grey diagram

2010-11-19 Thread Joshua Wiley
Hi Stephen,

In a session where that code returns an error, can you report the full
results of:

sessionInfo()
capabilities()

?

Josh

On Fri, Nov 19, 2010 at 8:14 PM, Stephen Liu sati...@yahoo.com wrote:
 Hi Josh,


 with(ToothGrowth, plot(dose, len))
 abline(lm(len ~ dose, data = ToothGrowth))

 ToothGrowth
 abline(lm(len ~ dose, data = ToothGrowth))
 Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
  plot.new has not been called yet

 ToothGrowth
 attach(ToothGrowth)
 abline(lm(len ~ dose, data = ToothGrowth))
 Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
  plot.new has not been called yet


 Sorry, still fail only an empty grey background diagram displayed.


 B.R.
 Stephen L



 - Original Message 
 From: Joshua Wiley jwiley.ps...@gmail.com
 To: Stephen Liu sati...@yahoo.com
 Cc: r-help@r-project.org
 Sent: Sat, November 20, 2010 10:50:42 AM
 Subject: Re: [R] An empty grey diagram

 Hi Stephen,

 Please try:

 with(ToothGrowth, plot(dose, len))
 abline(lm(len ~ dose, data = ToothGrowth))


 Cheers,

 Josh

 On Fri, Nov 19, 2010 at 6:44 PM, Stephen Liu sati...@yahoo.com wrote:
 Hi folks,

 Win7 64bit
 R 1.12.0

 I run following command on R:-

 ToothGrowth
 attach(ToothGrowth)
 plot(dose,len)
 matrics=lm(len~dose)

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

 Only a grey diagram is displayed without content


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

 With the same result.


 Pls advise what does it mean?  How to rectify it?  TIA


 B.R.
 Stephen L




 __
 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.




 --
 Joshua Wiley
 Ph.D. Student, Health Psychology
 University of California, Los Angeles
 http://www.joshuawiley.com/







-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/

__
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.


Re: [R] An empty grey diagram

2010-11-19 Thread David Winsemius


On Nov 19, 2010, at 11:29 PM, Joshua Wiley wrote:


Hi Stephen,

In a session where that code returns an error, can you report the full
results of:

sessionInfo()
capabilities()

?

Josh

On Fri, Nov 19, 2010 at 8:14 PM, Stephen Liu sati...@yahoo.com  
wrote:

Hi Josh,



with(ToothGrowth, plot(dose, len))
abline(lm(len ~ dose, data = ToothGrowth))


ToothGrowth
abline(lm(len ~ dose, data = ToothGrowth))
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
 plot.new has not been called yet


On my machine when there is no open plotting window I need to issue'

quartz()   # on a windows or otherNIX machine it would of course be  
a different command.


--
David.




ToothGrowth
attach(ToothGrowth)
abline(lm(len ~ dose, data = ToothGrowth))
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
 plot.new has not been called yet


Sorry, still fail only an empty grey background diagram displayed.


B.R.
Stephen L



- Original Message 
From: Joshua Wiley jwiley.ps...@gmail.com
To: Stephen Liu sati...@yahoo.com
Cc: r-help@r-project.org
Sent: Sat, November 20, 2010 10:50:42 AM
Subject: Re: [R] An empty grey diagram

Hi Stephen,

Please try:

with(ToothGrowth, plot(dose, len))
abline(lm(len ~ dose, data = ToothGrowth))


Cheers,

Josh

On Fri, Nov 19, 2010 at 6:44 PM, Stephen Liu sati...@yahoo.com  
wrote:

Hi folks,

Win7 64bit
R 1.12.0

I run following command on R:-


ToothGrowth
attach(ToothGrowth)
plot(dose,len)
matrics=lm(len~dose)



abline(metrics)

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

Only a grey diagram is displayed without content



plot(abline(metrics))

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

With the same result.


Pls advise what does it mean?  How to rectify it?  TIA


B.R.
Stephen L




__
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.





--
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/








--
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/

__
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.


David Winsemius, MD
West Hartford, CT

__
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.


Re: [R] An empty grey diagram

2010-11-19 Thread Stephen Liu
Hi Josh,

 sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: x86_64-pc-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C  
[5] LC_TIME=English_United States.1252    
attached base packages:
[1] stats graphics  grDevices datasets  utils methods   base 
other attached packages:
[1] rcom_2.2-3.1   rscproxy_1.3-1
loaded via a namespace (and not attached):
[1] tools_2.12.0


58 27.3   OJ  2.0
59 29.4   OJ  2.0
60 23.0   OJ  2.0
 
 abline(lm(len~dose, data = ToothGrowth))
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : 
  plot.new has not been called yet
 abline(lm(len ~ dose, data = ToothGrowth))
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : 
  plot.new has not been called yet
 sessioninfo()
Error: could not find function sessioninfo
 capabilities()
    jpeg  png tiff    tcltk  X11 aqua http/ftp  sockets 
    TRUE TRUE TRUE TRUE    FALSE    FALSE TRUE TRUE 
  libxml fifo   cledit    iconv  NLS  profmem    cairo 
    TRUE    FALSE TRUE TRUE TRUE TRUE    FALSE 


B.R.
Stephen L


 


- Original Message 
From: Joshua Wiley jwiley.ps...@gmail.com
To: Stephen Liu sati...@yahoo.com
Cc: r-help@r-project.org
Sent: Sat, November 20, 2010 12:29:07 PM
Subject: Re: [R] An empty grey diagram

Hi Stephen,

In a session where that code returns an error, can you report the full
results of:

sessionInfo()
capabilities()

?

Josh

On Fri, Nov 19, 2010 at 8:14 PM, Stephen Liu sati...@yahoo.com wrote:
 Hi Josh,


 with(ToothGrowth, plot(dose, len))
 abline(lm(len ~ dose, data = ToothGrowth))

 ToothGrowth
 abline(lm(len ~ dose, data = ToothGrowth))
 Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
  plot.new has not been called yet

 ToothGrowth
 attach(ToothGrowth)
 abline(lm(len ~ dose, data = ToothGrowth))
 Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
  plot.new has not been called yet


 Sorry, still fail only an empty grey background diagram displayed.


 B.R.
 Stephen L



 - Original Message 
 From: Joshua Wiley jwiley.ps...@gmail.com
 To: Stephen Liu sati...@yahoo.com
 Cc: r-help@r-project.org
 Sent: Sat, November 20, 2010 10:50:42 AM
 Subject: Re: [R] An empty grey diagram

 Hi Stephen,

 Please try:

 with(ToothGrowth, plot(dose, len))
 abline(lm(len ~ dose, data = ToothGrowth))


 Cheers,

 Josh

 On Fri, Nov 19, 2010 at 6:44 PM, Stephen Liu sati...@yahoo.com wrote:
 Hi folks,

 Win7 64bit
 R 1.12.0

 I run following command on R:-

 ToothGrowth
 attach(ToothGrowth)
 plot(dose,len)
 matrics=lm(len~dose)

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

 Only a grey diagram is displayed without content


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

 With the same result.


 Pls advise what does it mean?  How to rectify it?  TIA


 B.R.
 Stephen L




 __
 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.




 --
 Joshua Wiley
 Ph.D. Student, Health Psychology
 University of California, Los Angeles
 http://www.joshuawiley.com/







-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/




__
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.


Re: [R] An empty grey diagram

2010-11-19 Thread Stephen Liu
Hi Josh,


 with(ToothGrowth, plot(dose, len))
 abline(lm(len ~ dose, data = ToothGrowth))

ToothGrowth
abline(lm(len ~ dose, data = ToothGrowth))
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : 
  plot.new has not been called yet

ToothGrowth
attach(ToothGrowth)
abline(lm(len ~ dose, data = ToothGrowth))
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : 
  plot.new has not been called yet


Sorry, still fail only an empty grey background diagram displayed.


B.R.
Stephen L



- Original Message 
From: Joshua Wiley jwiley.ps...@gmail.com
To: Stephen Liu sati...@yahoo.com
Cc: r-help@r-project.org
Sent: Sat, November 20, 2010 10:50:42 AM
Subject: Re: [R] An empty grey diagram

Hi Stephen,

Please try:

with(ToothGrowth, plot(dose, len))
abline(lm(len ~ dose, data = ToothGrowth))


Cheers,

Josh

On Fri, Nov 19, 2010 at 6:44 PM, Stephen Liu sati...@yahoo.com wrote:
 Hi folks,

 Win7 64bit
 R 1.12.0

 I run following command on R:-

 ToothGrowth
 attach(ToothGrowth)
 plot(dose,len)
 matrics=lm(len~dose)

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

 Only a grey diagram is displayed without content


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

 With the same result.


 Pls advise what does it mean?  How to rectify it?  TIA


 B.R.
 Stephen L




 __
 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.




-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/




__
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.


Re: [R] An empty grey diagram

2010-11-19 Thread Joshua Wiley
It looks like all the packages you should need are loaded.  Does the
call to plot() create a scatter plot correctly?  abline() adds a line
to the current plot so that device still needs to be open when you
call abline() (which it should have been if you ran the code from my
first email).  If a graphic device does not start when you call plot()
then your error is earlier and you may need to explicitly open one (as
David suggested).


On Fri, Nov 19, 2010 at 8:38 PM, Stephen Liu sati...@yahoo.com wrote:
 Hi Josh,

 sessionInfo()
 R version 2.12.0 (2010-10-15)
 Platform: x86_64-pc-mingw32/x64 (64-bit)
 locale:
 [1] LC_COLLATE=English_United States.1252
 [2] LC_CTYPE=English_United States.1252
 [3] LC_MONETARY=English_United States.1252
 [4] LC_NUMERIC=C
 [5] LC_TIME=English_United States.1252
 attached base packages:
 [1] stats graphics  grDevices datasets  utils methods   base
 other attached packages:
 [1] rcom_2.2-3.1   rscproxy_1.3-1
 loaded via a namespace (and not attached):
 [1] tools_2.12.0


 58 27.3   OJ  2.0
 59 29.4   OJ  2.0
 60 23.0   OJ  2.0

 abline(lm(len~dose, data = ToothGrowth))
 Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
   plot.new has not been called yet
 abline(lm(len ~ dose, data = ToothGrowth))
 Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
   plot.new has not been called yet
 sessioninfo()
 Error: could not find function sessioninfo
 capabilities()
     jpeg  png tiff    tcltk  X11 aqua http/ftp  sockets
     TRUE TRUE TRUE TRUE    FALSE    FALSE TRUE TRUE
   libxml fifo   cledit    iconv  NLS  profmem    cairo
     TRUE    FALSE TRUE TRUE TRUE TRUE    FALSE


 B.R.
 Stephen L

__
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.


Re: [R] An empty grey diagram

2010-11-19 Thread David Winsemius


On Nov 19, 2010, at 11:14 PM, Stephen Liu wrote:


Hi Josh,



with(ToothGrowth, plot(dose, len))
abline(lm(len ~ dose, data = ToothGrowth))


ToothGrowth
abline(lm(len ~ dose, data = ToothGrowth))
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
 plot.new has not been called yet

ToothGrowth
attach(ToothGrowth)
abline(lm(len ~ dose, data = ToothGrowth))
Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
 plot.new has not been called yet


What happens when you follow the directions... i.e. type:

plot.new()#???





Sorry, still fail only an empty grey background diagram displayed.


B.R.
Stephen L



- Original Message 
From: Joshua Wiley jwiley.ps...@gmail.com
To: Stephen Liu sati...@yahoo.com
Cc: r-help@r-project.org
Sent: Sat, November 20, 2010 10:50:42 AM
Subject: Re: [R] An empty grey diagram

Hi Stephen,

Please try:

with(ToothGrowth, plot(dose, len))
abline(lm(len ~ dose, data = ToothGrowth))


Cheers,

Josh

On Fri, Nov 19, 2010 at 6:44 PM, Stephen Liu sati...@yahoo.com  
wrote:

Hi folks,

Win7 64bit
R 1.12.0

I run following command on R:-


ToothGrowth
attach(ToothGrowth)
plot(dose,len)
matrics=lm(len~dose)



abline(metrics)

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

Only a grey diagram is displayed without content



plot(abline(metrics))

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

With the same result.


Pls advise what does it mean?  How to rectify it?  TIA


B.R.
Stephen L




__
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.





--
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/




__
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.


David Winsemius, MD
West Hartford, CT

__
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.


Re: [R] An empty grey diagram

2010-11-19 Thread Stephen Liu
Hi David,


 What happens when you follow the directions... i.e. type:
 plot.new()#???

abline(lm(len ~ dose, data = ToothGrowth))
plot.new()

The grey background changes to white, still an empty graph

If continue on my version:-
abline(matrics)
plot(matrics$resid)

It plots a graph

B.R.
Stephen L







- Original Message 
From: David Winsemius dwinsem...@comcast.net
To: Stephen Liu sati...@yahoo.com
Cc: Joshua Wiley jwiley.ps...@gmail.com; r-help@r-project.org
Sent: Sat, November 20, 2010 1:08:21 PM
Subject: Re: [R] An empty grey diagram


On Nov 19, 2010, at 11:14 PM, Stephen Liu wrote:

 Hi Josh,


 with(ToothGrowth, plot(dose, len))
 abline(lm(len ~ dose, data = ToothGrowth))

 ToothGrowth
 abline(lm(len ~ dose, data = ToothGrowth))
 Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
  plot.new has not been called yet

 ToothGrowth
 attach(ToothGrowth)
 abline(lm(len ~ dose, data = ToothGrowth))
 Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
  plot.new has not been called yet

What happens when you follow the directions... i.e. type:

plot.new()#???




 Sorry, still fail only an empty grey background diagram displayed.


 B.R.
 Stephen L



 - Original Message 
 From: Joshua Wiley jwiley.ps...@gmail.com
 To: Stephen Liu sati...@yahoo.com
 Cc: r-help@r-project.org
 Sent: Sat, November 20, 2010 10:50:42 AM
 Subject: Re: [R] An empty grey diagram

 Hi Stephen,

 Please try:

 with(ToothGrowth, plot(dose, len))
 abline(lm(len ~ dose, data = ToothGrowth))


 Cheers,

 Josh

 On Fri, Nov 19, 2010 at 6:44 PM, Stephen Liu sati...@yahoo.com  
 wrote:
 Hi folks,

 Win7 64bit
 R 1.12.0

 I run following command on R:-

 ToothGrowth
 attach(ToothGrowth)
 plot(dose,len)
 matrics=lm(len~dose)

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

 Only a grey diagram is displayed without content


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

 With the same result.


 Pls advise what does it mean?  How to rectify it?  TIA


 B.R.
 Stephen L




 __
 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.




 -- 
 Joshua Wiley
 Ph.D. Student, Health Psychology
 University of California, Los Angeles
 http://www.joshuawiley.com/




 __
 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.

David Winsemius, MD
West Hartford, CT



__
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.


Re: [R] An empty grey diagram

2010-11-19 Thread Stephen Liu
Hi Josh,

plot.new()
the gray background changes to white colour.

If following my steps:-
plot(matrics$resid)

plots a new graph

B.R.
Stephen



- Original Message 
From: Joshua Wiley jwiley.ps...@gmail.com
To: Stephen Liu sati...@yahoo.com
Cc: r-help@r-project.org
Sent: Sat, November 20, 2010 12:57:41 PM
Subject: Re: [R] An empty grey diagram

It looks like all the packages you should need are loaded.  Does the
call to plot() create a scatter plot correctly?  abline() adds a line
to the current plot so that device still needs to be open when you
call abline() (which it should have been if you ran the code from my
first email).  If a graphic device does not start when you call plot()
then your error is earlier and you may need to explicitly open one (as
David suggested).


On Fri, Nov 19, 2010 at 8:38 PM, Stephen Liu sati...@yahoo.com wrote:
 Hi Josh,

 sessionInfo()
 R version 2.12.0 (2010-10-15)
 Platform: x86_64-pc-mingw32/x64 (64-bit)
 locale:
 [1] LC_COLLATE=English_United States.1252
 [2] LC_CTYPE=English_United States.1252
 [3] LC_MONETARY=English_United States.1252
 [4] LC_NUMERIC=C
 [5] LC_TIME=English_United States.1252
 attached base packages:
 [1] stats graphics  grDevices datasets  utils methods   base
 other attached packages:
 [1] rcom_2.2-3.1   rscproxy_1.3-1
 loaded via a namespace (and not attached):
 [1] tools_2.12.0


 58 27.3   OJ  2.0
 59 29.4   OJ  2.0
 60 23.0   OJ  2.0

 abline(lm(len~dose, data = ToothGrowth))
 Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
   plot.new has not been called yet
 abline(lm(len ~ dose, data = ToothGrowth))
 Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) :
   plot.new has not been called yet
 sessioninfo()
 Error: could not find function sessioninfo
 capabilities()
 jpeg  png tifftcltk  X11 aqua http/ftp  sockets
 TRUE TRUE TRUE TRUEFALSEFALSE TRUE TRUE
   libxml fifo   clediticonv  NLS  profmemcairo
 TRUEFALSE TRUE TRUE TRUE TRUEFALSE


 B.R.
 Stephen L




__
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.


Re: [R] An empty grey diagram

2010-11-19 Thread Joshua Wiley
On Fri, Nov 19, 2010 at 9:35 PM, Stephen Liu sati...@yahoo.com wrote:
 Hi David,


 What happens when you follow the directions... i.e. type:
 plot.new()    #???

 abline(lm(len ~ dose, data = ToothGrowth))
 plot.new()

 The grey background changes to white, still an empty graph

You cannot just use abline() on an empty graphic (well, you can but
you get an empty graph).  Please actually run my code, it will create
a scatter plot, then add a line.  Do not close the graphic device in
between.

with(ToothGrowth, plot(dose, len))
abline(lm(len ~ dose, data = ToothGrowth))

__
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.


Re: [R] An empty grey diagram

2010-11-19 Thread Stephen Liu

ToothGrowth
attach(ToothGrowth)
abline(lm(len ~ does, data = ToothGrowth))

an empty gray graph displayed

continue
plot.new()

the background changes to white colour, still an empty graph

B.R.
satimis





- Original Message 
From: Joshua Wiley jwiley.ps...@gmail.com
To: Stephen Liu sati...@yahoo.com
Cc: r-help@r-project.org
Sent: Sat, November 20, 2010 1:39:45 PM
Subject: Re: [R] An empty grey diagram

On Fri, Nov 19, 2010 at 9:35 PM, Stephen Liu sati...@yahoo.com wrote:
 Hi David,


 What happens when you follow the directions... i.e. type:
 plot.new()#???

 abline(lm(len ~ dose, data = ToothGrowth))
 plot.new()

 The grey background changes to white, still an empty graph

You cannot just use abline() on an empty graphic (well, you can but
you get an empty graph).  Please actually run my code, it will create
a scatter plot, then add a line.  Do not close the graphic device in
between.

with(ToothGrowth, plot(dose, len))
abline(lm(len ~ dose, data = ToothGrowth))




__
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.