On Mon, Jun 1, 2009 at 11:33 AM, Wacek Kusnierczyk < waclaw.marcin.kusnierc...@idi.ntnu.no> wrote:
> ... there is an ugly lack of consistency here:... > I agree that it's inconsistent that 1:'2' --> 1:2 # this doesn't seem to be documented in ? seq 1+ '2' --> error 1+factor(2) --> NA (with a warning) 1 : factor(4) --> 1 (uses as.numeric/unclass of factor) > ...i'd expect ...a successful computation (with a character -> numeric > coercion of '2' to 2)... > But I disagree that the best thing to do here is to have them all coerce to numerics. In scripting languages like Perl which are constantly going back and forth between internal and external representations, it makes some sense to auto-convert numeric strings to numerics and vice versa, but I don't think it makes sense in a statistical language. I would rather see them all give errors. -s [[alternative HTML version deleted]] ______________________________________________ R-help@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.