[R] How to get warning about implicit factor to integer coercion?

Ista Zahn izahn at psych.rochester.edu
Mon Feb 14 15:53:49 CET 2011


Hi,
I think an example would be helpful. I'm not sure what behavior you
are referring to.

best,
Ista
On Mon, Feb 14, 2011 at 5:31 AM, WB Kloke <wb at ifado.de> wrote:
> Is there a way in R (12.x) to avoid the implicit coercion of factors to integers
> in the context of subscripts?
>
> If this is not possible, is there a way to get at least a warning, if any
> coercion of this type happens, given that the action of this coercion is almost
> never what is wanted?
>
> Of course, in the rare case that as.integer() is applied explicitly onto a
> factor, the warning is not needed, but certainly not as disastrous as in the
> other case.
>
> Probably, in a future version of R, an option similar to that for partial
> matches of subscripts might be useful to change the default from maximal
> unsafety to safe use.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org



More information about the R-help mailing list