[R] how does R represent numbers?
wsi at gcal.ac.uk
Thu Sep 13 14:53:09 CEST 2001
I just found out that R assumes that vectors created with the : operator
Vectors created with seq() can be integer
The vector is double if I do it like this:
rep() seems to make doubles:
A single number with no decimal place is double:
This is the reason I previously thought all numbers were double in R.
Maybe there's a good reason for this situation, but it seems strange and
inconsistent to me.
This might be a silly suggestion, but how about:
* all numbers assumed to be double unless explicitly set as integer *
* using integer() or changed to integer using as.integer() *
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help