Displaying 20 results from an estimated 30000 matches similar to: "Integers in S-Plus and R"
2015 Apr 17
1
behavior of as.integer("5000000000")
>>>>> Martin Maechler <maechler at lynne.stat.math.ethz.ch>
>>>>> on Fri, 17 Apr 2015 15:49:35 +0200 writes:
>>>>> Herv? Pag?s <hpages at fredhutch.org>
>>>>> on Mon, 13 Apr 2015 23:36:14 -0700 writes:
>> On 04/13/2015 11:32 PM, Martin Maechler wrote:
>>>
>>>> Hi,
2015 Apr 14
3
behavior of as.integer("5000000000")
On 04/13/2015 11:32 PM, Martin Maechler wrote:
>
>> Hi,
>> > as.integer("5000000000")
>> [1] 2147483647
>> Warning message:
>> inaccurate integer conversion in coercion
>
>> > as.integer("-5000000000")
>> [1] NA
>> Warning message:
>> inaccurate integer conversion in coercion
>
2015 Apr 14
3
behavior of as.integer("5000000000")
Hi,
> as.integer("5000000000")
[1] 2147483647
Warning message:
inaccurate integer conversion in coercion
> as.integer("-5000000000")
[1] NA
Warning message:
inaccurate integer conversion in coercion
Is this a bug or a feature? The man page suggests it's the latter:
?as.integer? attempts to coerce its argument to be of integer
type.
2003 Jan 08
2
Undocumented bahavior of as.integer() (PR#2430)
as.integer() truncates doubles toward zero, as Splus does (at least v. 6.1
under Windows does). Thus:
> look <- (10 * seq(14)) - 76
> 10 * (73.1 + look)
[1] 71 171 271 371 491 586 681 791 886 981 1101 1201 1301 1401
> as.integer(10 * (73.1 + look))
[1] 70 170 270 370 490 586 681 791 886 981 1101 1201 1301 1401
... It is not documented in R! I propose appending
2020 Jan 19
2
rpois(9, 1e10)
On my Mac:
str(.Machine)
...
$ integer.max????????? : int 2147483647
?$ sizeof.long????????? : int 8
?$ sizeof.longlong????? : int 8
?$ sizeof.longdouble??? : int 16
?$ sizeof.pointer?????? : int 8
????? On a Windows 10 machine I have, $ sizeof.long : int 4; otherwise
the same as on my Mac.
????? Am I correct that $ sizeof.long = 4 means 4 bytes = 32 bits?
log2(.Machine$integer.max)
2020 Jan 19
2
rpois(9, 1e10)
On 2020-01-19 13:01, Avraham Adler wrote:
> Crazy thought, but being that a sum of Poissons is Poisson in the sum,
> can you break your ?big? simulation into the sum of a few smaller
> ones? Or is the order of magnitude difference just too great?
????? I don't perceive that as feasible.? Once I found what was
generating NAs, it was easy to code a function to return pseudo-random
2020 Jan 20
2
[External] Re: rpois(9, 1e10)
Thanks to Luke and Avi for their comments.? I wrapped "round" around the
call to "rnorm" inside my "rpois.".? For "lambda" really big, that
"round" won't do anything.? However, it appears to give integers in
floating point representation that are larger than
.Machine$integer.max.? That sounds very much like what someone would
want.?
2006 Nov 28
1
Can anyone read a S-PLUS .dmp file for me?
Hi WizaRds,
I tried reading the S-PLUS file
ftp://ftp.research.att.com/dist/bayes-meta/hblm.dmp
into R using
data.restore("hblm.dmp")
but I got an error:
Error in attributes(value) <- thelist[-match(c(".Data", ".Dim", ".Dimnames", :
row names must be 'character' or 'integer', not 'double'
In
2015 Apr 17
0
behavior of as.integer("5000000000")
>>>>> Herv? Pag?s <hpages at fredhutch.org>
>>>>> on Mon, 13 Apr 2015 23:36:14 -0700 writes:
> On 04/13/2015 11:32 PM, Martin Maechler wrote:
>>
>>> Hi,
>>> > as.integer("5000000000")
>>> [1] 2147483647
>>> Warning message:
>>> inaccurate integer conversion in
2020 Jan 19
2
rpois(9, 1e10)
????? This issue arose for me in simulations to estimate confidence,
prediction, and tolerance intervals from glm(., family=poisson) fits
embedded in a BMA::bic.glm fit using a simulate.bic.glm function I added
to the development version of Ecfun, available at
"https://github.com/sbgraves237/Ecfun".? This is part of a vignette I'm
developing, available at
2003 Jan 03
0
RE: stange behavior of subset [] (was: lowess + turnpoints = doubling integers?)
Tom Blackwell wrote:
>...
>I summarized this to myself as "computed subscripts need explicit
>rounding in R, but not in S". Here's the sample code which gave
>me different results with R than with Splus. I no longer have
>Splus available, so I can't check it again.
>look <- (10 * seq(14)) - 76
>chk.1 <- seq(1420)[ 10 * (73.1 + look) ] #
2016 Aug 03
2
seq.int does not return a sequence of integers sometimes
I have a script that goes wrong because I assumed that seq.int would
return integers.
Below please see it does not unless user is super cautious about
inserting "L" with inputs. I think seq.int should do coercion for me
before returning the sequence.
> xx <- seq.int(1,10)
> class(xx)
[1] "integer"
> is.integer(xx)
[1] TRUE
> xx <- seq.int(1,10, 2)
>
2011 Feb 14
2
How to get warning about implicit factor to integer coercion?
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,
2007 Jul 26
1
Creating a cross table out of a large dataset
Dear all,
I want to make a cross table out of a data set which is 2 columns wide and
more than 150000 rows long. When I use the table() function I get an error
message
This is the code I have used:
>Dataset <- read.table("test.txt", header=TRUE, sep=",", na.strings="NA",
dec=".", strip.white=TRUE)
> .T <-table(Dataset$K1,Dataset$K2)
This
2020 Jan 20
0
[External] Re: rpois(9, 1e10)
R uses the C 'int' type for its integer data and that is pretty much
universally 32 bit these days. In fact R wont' compile if it is not.
That means the range for integer data is the integers in [-2^31,
+2^31).
It would be good to allow for a larger integer range for R integer
objects, and several of us are thinking about how me might get there.
But it isn't easy to get right, so
2020 Jan 20
0
[External] Re: rpois(9, 1e10)
>>>>> Spencer Graves
>>>>> on Sun, 19 Jan 2020 21:35:04 -0600 writes:
> Thanks to Luke and Avi for their comments.? I wrapped "round" around the
> call to "rnorm" inside my "rpois.".? For "lambda" really big, that
> "round" won't do anything.? However, it appears to give integers in
2020 Jan 19
2
rpois(9, 1e10)
So imagine rpois is changed, such that the storage mode of its return
value is sometimes integer and sometimes numeric. Then imagine the case
where lambda is itself a realization of a random variable. Do we really
want the storage mode to inherit that randomness?
On 1/19/20 10:47 AM, Avraham Adler wrote:
> Maybe there should be code for 64 bit R to use long long or the like?
>
> On
2020 Jan 19
0
rpois(9, 1e10)
Floor (maybe round) of non-negative numerics, though. Poisson should never
have anything after decimal.
Still think it?s worth allowing long long for R64 bit, just for purity
sake.
Avi
On Sun, Jan 19, 2020 at 4:38 PM Spencer Graves <spencer.graves at prodsyse.com>
wrote:
>
>
> On 2020-01-19 13:01, Avraham Adler wrote:
>
> Crazy thought, but being that a sum of Poissons is
2012 Oct 16
1
How to create a high-dimensional matrix
Hi, everyone
I need to create a 429497 x 429497 matrix.
When I use
*matrix(0,429497,429497)*
I got the error information : Error in matrix(0, 429497, 429497) : too many
elements specified
Then I use "ff" package, try to store this matrix on disk
* x<-ff(0,dim=c(429497,429497)*
And I got the error information :
Error in if (length < 0 || length > .Machine$integer.max)
2004 Jan 20
1
Restoring an S object that was data-dumped
Hi:
In R, how can I "data.restore" an object that was "data.dump"ed in
Splus (I am not sure of the exact version, but probably Splus5)?
When I use data.restore, I get the following error message (I am using
R 1.7.0 on Windows)
> data.restore("n2.suicide")
Error in ReadSdump(TRUE, " ") : S
mode " "Netherlands",