[R] Strange behaviour in plot and points?

miguel bernal miguel.bernal at ma.ieo.es
Tue Jul 2 11:14:45 CEST 2002


Hello R-users

I was puzzled by some strange results of an analysis and I found out what is 
for me a strange behaviour (I won't dare to say a bug) in both plot and 
points (and I suspect lines and other kind of lower level plots). If you try 
the following code:

> data<-data.frame(dummy1=c(1:10),dummy2=c(1:10))
> plot(data$dummy1,data$dummy3)

A plot of the values of dummy1 against an index is produced, even when dummy3 
does not exist. Same happens with points. Also, the index is used as the 
x-axis, so specially when using points in a plot already made, the results 
can be missleading. 

Wouldn't it be better to just have an error message saying dummy3 does not 
exist? 

I assume this behaviour is not release, nor plattform dependent, but just in 
case, I am using R 1.5.0 on Mandrake 8.2 Linux.

Thanks for your comments

-- 
Miguel Bernal

Instituto Español de Oceanografía
Centro Oceanográfico de Malaga
Puerto pesquero s/n 29640, Fuengirola.
Malaga, Spain
Tlf: (34) 952 471907; Fax: (34) 952 463808
e-mail: miguel.bernal at ma.ieo.es
http:\\www.ieo.es
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list