From rphilip.chalmers at gmail.com  Thu May  2 17:50:06 2013
From: rphilip.chalmers at gmail.com (philchalmers)
Date: Thu, 2 May 2013 08:50:06 -0700 (PDT)
Subject: [Rd] diag() when input is a numeric scalar
In-Reply-To: <CAAmySGPLSZhkDCx7EnfVNY08Sf4goZPTiULDGWQex2f-qd_UXg@mail.gmail.com>
References: <1367451316781-4665986.post@n4.nabble.com>
	<CAAmySGPLSZhkDCx7EnfVNY08Sf4goZPTiULDGWQex2f-qd_UXg@mail.gmail.com>
Message-ID: <1367509806804-4666072.post@n4.nabble.com>

Thanks for the reply Michael,

Although I probably would lean a bit more to the 'strict mode', I wouldn't
suggest changing the default behavior since it could break existing code and
goes against R's current philosophy. However, adding an additional argument
to some functions where the floating digits are ambiguous would be helpful,
or allowing for an optional warning message would also work to avoid these
problems.

Perhaps better yet would be to include a global argument to option() to
check for this type of default float to int coercion in base functions,
simply to see if the users code does follow a kind of 'strict mode', and to
print warnings whenever this occurs in areas where integers are needed and
floats are being coerced. This way the base functionality would remain the
same, but those who wanted to be warned about where the potential
as.integer() ambiguity is occurring could know (personally, I would leave it
on all the time, but that's a matter of preference). I wouldn't be so bold
as to change what R currently does, but I would like the option to make it
more strict if requested. Cheers.

Phil
  



--
View this message in context: http://r.789695.n4.nabble.com/diag-when-input-is-a-numeric-scalar-tp4665986p4666072.html
Sent from the R devel mailing list archive at Nabble.com.



[Rd] diag() when input is a numeric scalar
philchalmers