From sokol at insa-toulouse.fr  Thu Apr 19 13:29:54 2018
From: sokol at insa-toulouse.fr (Serguei Sokol)
Date: Thu, 19 Apr 2018 13:29:54 +0200
Subject: [Rd] R Bug: write.table for matrix of more than 2, 147, 483,
 648 elements
In-Reply-To: <c9b2730a-0575-25a5-3bad-cd6690108af8@gmail.com>
References: <20180418212319.34878428@hypatia.math.ethz.ch>
 <e523f994-7f4c-b94f-dcda-1a0b96c70d06@gmail.com>
 <ccd7638e-3105-cad1-1eb4-87120a47d0da@gmail.com>
 <0b1ada3d-fdf0-b975-d5c4-70fe353de7c9@insa-toulouse.fr>
 <c9b2730a-0575-25a5-3bad-cd6690108af8@gmail.com>
Message-ID: <79246184-3512-7e1b-78d7-f741fccdd9f8@insa-toulouse.fr>

Le 19/04/2018 ? 12:15, Tomas Kalibera a ?crit?:
> On 04/19/2018 11:47 AM, Serguei Sokol wrote:
>>

>> replace
>> ??? tmp = EncodeElement2(x, i + j*nr, quote_col[j], qmethod,
>> ??? ??? ??? ??? ??? &strBuf, sdec);
>> by
>> ??? tmp = EncodeElement2(VECTOR_ELT(x, (R_xlen_t)i + j*nr), 0, 
>> quote_col[j], qmethod,
>> ??? ??? ??? ??? ??? &strBuf, sdec);
>
> Unfortunately we can't do that, x is a matrix of an atomic vector 
> type. VECTOR_ELT is taking elements of a generic vector, so it cannot 
> be applied to "x". But even if we extracted a single element from "x" 
> (e.g. via a type-switch etc), we would not be able to pass it to 
> EncodeElement0 which expects a full atomic vector (that is, including 
> its header). Instead we would have to call functions like 
> EncodeInteger, EncodeReal0, etc on the individual elements. Which is 
> then the same as changing EncodeElement0 or implementing a new version 
> of it. This does not seem that hard to fix, just is not as trivial as 
> changing the cast..

Thanks Tomas for this detailed explanation.

I would like also to signal a problem with the list. It must be 
corrupted in some way because beside the Tomas'? response I've got five 
or six (so far) dating spam. All of them coming from two emails: 
Kristina Oliynik <kristinaoliynik604324 at kw.taluss.com> and Samantha 
Smith <samanthasmith317260 at kw.fefty.com>.

Serguei.



[Rd] R Bug: write.table for matrix of more than 2, 147, 483, 648 elements
Serguei Sokol