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

From: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk_at_idi.ntnu.no>
Date: Sun, 22 Feb 2009 21:06:03 +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.
>
>
line 454+ in src/main/unique.c:

    if (!isVector(x)) {
    PrintValue(x);
    error(_("%s() applies only to vectors"),

          (PRIMVAL(op) == 0 ? "duplicated" : "unique"));     }

in your example, quote() produces a non-vector, hence the output before the error message.

vQ



R-devel_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun 22 Feb 2009 - 19:09:46 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 - 19:30:51 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