Hello, I think the following qualify as a bug given: x<-c(1,2,3,4,2,4,2,2,4,2,2,2,4,3,2,1) z<-embed(x,4) z [,1] [,2] [,3] [,4] [1,] 4 3 2 1 [2,] 2 4 3 2 [3,] 4 2 4 3 [4,] 2 4 2 4 [5,] 2 2 4 2 [6,] 4 2 2 4 [7,] 2 4 2 2 [8,] 2 2 4 2 [9,] 2 2 2 4 [10,] 4 2 2 2 [11,] 3 4 2 2 [12,] 2 3 4 2 [13,] 1 2 3 4>max.col(z) [1] 1 2 3 4 3 1 2 3 4 1 2 3 4 Why? ^ ^> 1 2or should be [1] 1 2 3 4 3 4 2 3 4 1 2 3 4 i.e. the first column with the max, or the last column same if z <- embed(x,5) max.col(z) [1] 2 1 2 5 1 5 3 4 1 2 3 4 where it should be either of: 2 1 2 3 1 2 3 4 1 2 3 4 2 3 4 5 4 5 3 4 5 2 3 4 or I am missing something? ?max.col does not return anything R 1.7.0 on Win98 . Heberto.Ghezzo at McGill.ca
The only problem is that in your R installation ?max.col does (as you say) not give you the help information. ==> problem with your installation only Because help pages says>> Details: >> >> Ties are broken at random. The determination of ``tie'' assumes >> that the entries are probabilities: there is a relative tolerance >> of 1e-5, relative to the largest entry in the row.and you *do* have ties, hence the result is random. Regards, Martin Maechler <maechler at stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <><>>>>> "heberto" == heberto ghezzo <g.heberto at lycos.com> >>>>> on Thu, 24 Apr 2003 12:07:22 -0400 writes:heberto> Hello, I think the following qualify as a bug heberto> given: heberto> x<-c(1,2,3,4,2,4,2,2,4,2,2,2,4,3,2,1) heberto> z<-embed(x,4) heberto> z heberto> [,1] [,2] [,3] [,4] heberto> [1,] 4 3 2 1 heberto> [2,] 2 4 3 2 heberto> [3,] 4 2 4 3 heberto> [4,] 2 4 2 4 heberto> [5,] 2 2 4 2 heberto> [6,] 4 2 2 4 heberto> [7,] 2 4 2 2 heberto> [8,] 2 2 4 2 heberto> [9,] 2 2 2 4 heberto> [10,] 4 2 2 2 heberto> [11,] 3 4 2 2 heberto> [12,] 2 3 4 2 heberto> [13,] 1 2 3 4 >> heberto> max.col(z) heberto> [1] 1 2 3 4 3 1 2 3 4 1 2 3 4 heberto> Why? ^ ^ >> 1 2 heberto> or should be heberto> [1] 1 2 3 4 3 4 2 3 4 1 2 3 4 heberto> i.e. the first column with the max, or the last column heberto> same if heberto> z <- embed(x,5) heberto> max.col(z) heberto> [1] 2 1 2 5 1 5 3 4 1 2 3 4 heberto> where it should be either of: heberto> 2 1 2 3 1 2 3 4 1 2 3 4 heberto> 2 3 4 5 4 5 3 4 5 2 3 4 heberto> or I am missing something? heberto> ?max.col does not return anything heberto> R 1.7.0 on Win98 heberto> . heberto> Heberto.Ghezzo at McGill.ca heberto> ______________________________________________ heberto> R-help at stat.math.ethz.ch mailing list heberto> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
On Thu, 24 Apr 2003, heberto ghezzo wrote:> Hello, I think the following qualify as a bug.>From ?max.colDetails: Ties are broken at random. The determination of ``tie'' assumes ^^^^^^^^^^^^^^^^^^^^^^^^^^ that the entries are probabilities: there is a relative tolerance of 1e-5, relative to the largest entry in the row.> given: > x<-c(1,2,3,4,2,4,2,2,4,2,2,2,4,3,2,1) > z<-embed(x,4) > z > [,1] [,2] [,3] [,4] > [1,] 4 3 2 1 > [2,] 2 4 3 2 > [3,] 4 2 4 3 > [4,] 2 4 2 4 > [5,] 2 2 4 2 > [6,] 4 2 2 4 > [7,] 2 4 2 2 > [8,] 2 2 4 2 > [9,] 2 2 2 4 > [10,] 4 2 2 2 > [11,] 3 4 2 2 > [12,] 2 3 4 2 > [13,] 1 2 3 4 > > > max.col(z) > [1] 1 2 3 4 3 1 2 3 4 1 2 3 4 > Why? ^ ^ > > 1 2 > or should be > [1] 1 2 3 4 3 4 2 3 4 1 2 3 4 > i.e. the first column with the max, or the last column > same if > z <- embed(x,5) > max.col(z) > [1] 2 1 2 5 1 5 3 4 1 2 3 4 > where it should be either of: > 2 1 2 3 1 2 3 4 1 2 3 4 > 2 3 4 5 4 5 3 4 5 2 3 4 > or I am missing something?Reading the help page.> ?max.col does not return anythingIt does on my system. -- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
heberto ghezzo wrote:> Hello, I think the following qualify as a bug > given: > x<-c(1,2,3,4,2,4,2,2,4,2,2,2,4,3,2,1) > z<-embed(x,4) > z > [,1] [,2] [,3] [,4] > [1,] 4 3 2 1 > [2,] 2 4 3 2 > [3,] 4 2 4 3 > [4,] 2 4 2 4 > [5,] 2 2 4 2 > [6,] 4 2 2 4 > [7,] 2 4 2 2 > [8,] 2 2 4 2 > [9,] 2 2 2 4 > [10,] 4 2 2 2 > [11,] 3 4 2 2 > [12,] 2 3 4 2 > [13,] 1 2 3 4 > > max.col(z) > [1] 1 2 3 4 3 1 2 3 4 1 2 3 4 > Why? ^ ^ > >> 1 2 > > or should be > [1] 1 2 3 4 3 4 2 3 4 1 2 3 4 > i.e. the first column with the max, or the last column > same if > z <- embed(x,5) > max.col(z) > [1] 2 1 2 5 1 5 3 4 1 2 3 4 > where it should be either of: > 2 1 2 3 1 2 3 4 1 2 3 4 > 2 3 4 5 4 5 3 4 5 2 3 4 > or I am missing something?Reading the word "random" in its help file: "Find the maximum position for each row of a matrix, breaking ties at random." You observed another bug: The Compiled HTML help file (on Windows) doesn't come up with ?max.col. Nevertheless, brosing through the index results in a working link (and a page). I'm not sure whether the bug is in R or in Microsoft's help compiler ... I will take a look later (and move the thread to R-devel in case of further investigations). Uwe Ligges> ?max.col does not return anything > R 1.7.0 on Win98 > . > Heberto.Ghezzo at McGill.ca > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Uwe Ligges
2003-Apr-24 20:10 UTC
[Rd] Windows chmhelp fails for files called ....col.Rd; was: [R] problems with max.col()
[shifting the R-help thread to R-devel] Uwe Ligges wrote:> heberto ghezzo wrote: > >[SNIP]> You observed another bug: The Compiled HTML help file (on Windows) > doesn't come up with ?max.col. Nevertheless, brosing through the index > results in a working link (and a page). > > I'm not sure whether the bug is in R or in Microsoft's help compiler ... > I will take a look later (and move the thread to R-devel in case of > further investigations). > > Uwe LiggesI think it's a bug in Microsoft's html help compiler. The point seems to be that the lookup doesn't work for files called *.col.Rd, which are correctly processed by R's help building scripts (html files, index files, toc files are all generated correctly, AFAICS). The cause might be that col has several meaning in compiled html help, particularly there is a file extension ".col" defined for "single Help collection". Uwe Ligges