Re: [Rd] 'unique' error message is printed despite silent=TRUE (PR#13547)

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Sun, 22 Feb 2009 21:16:18 +0100

macrakis_at_alum.mit.edu wrote:
> In 2.8.0/Windows Vista:
>
> When 'unique' gives a type error message, it prints out even if errors
> are being caught:
>

>> try(unique(quote(hello)),silent=TRUE)

> hello
>
> This comes from the .Internal unique routine:
>
>> try(.Internal(unique(quote(hello),NULL,NULL)),silent=TRUE)

> hello
>
> I guess it is using the internal equivalent of print rather than the
> internal equivalent of stop.
>

silent=TRUE is a red herring (this has nothing to do with try()).

However, inside do_duplicated (unique.c) we have

     if (!isVector(x)) {
	PrintValue(x);
	error(_("%s() applies only to vectors"),
	      (PRIMVAL(op) == 0 ? "duplicated" : "unique"));
     }

This is due to



r32306 | ripley | 2004-12-23 22:06:27 +0100 (Thu, 23 Dec 2004) | 2 lines

Apparently unique/duplicated are supposed to work on NULL, despite their help!

...which makes little sense to explain the PrintValue(x). I suspect this is a debugging printout that was inadvertently left in.

-- 
    O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard_at_biostat.ku.dk)              FAX: (+45) 35327907

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sun 22 Feb 2009 - 19:29:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 22 Feb 2009 - 20:30:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive