On 25-04-2014, at 17:09, Allin Cottrell <cottrell(a)wfu.edu> wrote:
On Fri, 25 Apr 2014, Ignacio Diaz-Emparanza wrote:
> On 25/04/14 15:38, oleg_komashko(a)ukr.net wrote:
>>
>> to easily see the possible bug:
>>
>> run
>> #begin
>> nulldata 100
>> setobs 1 1910 --time-series
>> series norm = randgen(N,15000,200)
>> # end
>> start interactive R session and type in R console
>>> gretldata
>> What I obtained started as follows:
>> index norm
>> 1910 1 15
>> 1911 2 1
>> 1912 3 60
>>
>> !
>
> I see no problem here. Annual data from 1910 to 2009 are correctly shown.
> (Gretl from CVS with Ubuntu 12.04).
I think it depends on the R version. In R 3.1.0 there's a "new feature"
(in fact, a backwardly incompatible change) described as follows:
"type.convert() (and hence by default read.table()) returns a character
vector or factor when representing a numeric input as a double would lose
accuracy."
So if we happen to print data for consumption by R with more than (I
suppose) 16 significant digits it gets silently borked.
I copied the first 21 lines of the file written by Gretl to a new .csv ( see the attached
file).
And used this R code:
gdata <- read.table("gretldat.csv",
header=TRUE,colClasses="numeric")
gdata
str(gdata)
print(gdata,digits=16)
to read the data.
This seem prints the data correctly and in addition all columns of gdata are numeric.
Berend