[R] Error in inherits(x, "data.frame") : subscript out of bounds

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Wed Jun 19 20:40:39 CEST 2002


On Wed, 19 Jun 2002, Czerminski, Ryszard wrote:

> Hi, I have this little problem with "dist" function
> and I cannot find anything matching in mail archives
>
> > o
>      [,1] [,2] [,3]
> [1,]    1    0    3
> [2,]    2    0    6
> [3,]    3    0    9
> > dist(o)
> Error in inherits(x, "data.frame") : subscript out of bounds
>
> If you have any insights, which might illuminate R-neophyte...
> I would highly appreciate it.

What version of R and dist is this?  The version in the current R
(package mva) does not include that line, and it works:

> o <- matrix(c(1:3, rep(0,3), 3*(1:3)),3)
> o
     [,1] [,2] [,3]
[1,]    1    0    3
[2,]    2    0    6
[3,]    3    0    9
> dist(o)
         1        2
2 3.162278
3 6.324555 3.162278

Try

> conflicts("dist")


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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