[Rd] Error report on empty matrices (PR#435)

Thomas Lumley thomas@biostat.washington.edu
Mon, 14 Feb 2000 14:01:07 -0800 (PST)


On Mon, 14 Feb 2000 Ulrich.Kuesters@t-online.de wrote:

> Dear R developers:
> 
> When using R.0.99a (Version 0.99.0 Patched (February 9, 2000), source
> compiled with gcc under SuSE 6.2) on a PIII 500Mhz Machine under SuSE
> 6.2 Linux I found the following bug:
> 
>   x <- matrix(0,10,0)    
>   rbind(x,2)
> 
> causes an R-crash with the message "Gleitkomma-Ausnahme" (floating point
> exception) which is probably due to the non-applicability of the
> recyling rule.
> 
> The same occors when using
>   x<-matrix(0,10,0)
>   rbind(x,matrix(2,1,1))
> 
> The complete log is appended to this note.
> 
> In my opinion an error message like
> 
>   Error in rbind(...) : number of columns of matrices must match (see
> arg 2)   

The second case should have this. The first case should (I think) return
an 11x0 matrix and give a recycling warning.

That is, rbind(x,2) should append a 2  to all the columns of x.

	-thomas

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

> 
> as it happens with
> 
>   x<-matrix(0,10,1)    
>   rbind(x,matrix(0,1,0))  
> 
> should be given in both erroneous cases. 
> 
> Best regards 
> 
>       Ulrich Küsters
> 
> 
> ------- Complete Log
> -----------------------------------------------------
> 
> ulk@apollo:~ >  R --vanilla
> 
> R : Copyright 2000, The R Development Core Team
> Version 0.99.0 Patched (February 9, 2000)
> 
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type    "?license" or "?licence" for distribution details.
> 
> R is a collaborative project with many contributors.
> Type    "?contributors" for a list.
> 
> Type    "demo()" for some demos, "help()" for on-line help, or
>         "help.start()" for a HTML browser interface to help.
> Type    "q()" to quit R.
> 
> > x <- matrix(0,10,0)
> >   rbind(x,2)
> Gleitkomma-Ausnahme
> ulk@apollo:~ > R --vanilla
> 
> R : Copyright 2000, The R Development Core Team
> Version 0.99.0 Patched (February 9, 2000)
> 
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type    "?license" or "?licence" for distribution details.
> 
> R is a collaborative project with many contributors.
> Type    "?contributors" for a list.
> 
> Type    "demo()" for some demos, "help()" for on-line help, or
>         "help.start()" for a HTML browser interface to help.
> Type    "q()" to quit R.
> 
> > x<-matrix(0,10,0)
> >   rbind(x,matrix(2,1,1))
> Gleitkomma-Ausnahme
> ulk@apollo:~ >               
> 
> -----------------------------------------------------------------
> 
> --please do not edit the information below--
> 
> Version:
>  platform = i686-unknown-linux
>  arch = i686
>  os = linux
>  system = i686, linux
>  status = Patched
>  major = 0
>  minor = 99.0
>  year = 2000
>  month = February
>  day = 9
>  language = R
> 
> Search Path:
>  .GlobalEnv, Autoloads, package:base
> ~
> ~              
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> **************************************
> * Univ.-Prof. Dr. Ulrich Küsters     *
> * Feuchtwangerstr. 3                 *
> * D-85049 Ingolstadt                 *
> *                                    *
> * Tel/Fax: 0841-84901                *
> * Email: ulrich.kuesters@t-online.de *
> **************************************
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-devel 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-devel-request@stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._