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

philchalmers rphilip.chalmers at gmail.com
Thu May 2 17:50:06 CEST 2013

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

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.


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.

More information about the R-devel mailing list