[julia-users] Re: C wrapper ReadStat : read files from Stata, SPSS and SAS.

2015-10-12 Thread Douglas Bates
On Monday, October 12, 2015 at 11:24:06 AM UTC-5, Matt wrote: > > ReadStat is an excellent C library by Evan Millers that allows to read > files from Stata, SPSS and SAS. > Evan wrote a wrapper for ReadStat in the Dataread.jl package > https://github.com/WizardMac/DataRead.jl > However, the

[julia-users] Re: C wrapper ReadStat : read files from Stata, SPSS and SAS.

2015-10-12 Thread Steven G. Johnson
On Monday, October 12, 2015 at 3:30:18 PM UTC-4, Douglas Bates wrote: > > On Monday, October 12, 2015 at 11:24:06 AM UTC-5, Matt wrote: >> >> ReadStat is an excellent C library by Evan Millers that allows to read >> files from Stata, SPSS and SAS. >> Evan wrote a wrapper for ReadStat in the

Re: [julia-users] Re: C wrapper ReadStat : read files from Stata, SPSS and SAS.

2015-10-12 Thread Yichao Yu
On Mon, Oct 12, 2015 at 6:46 PM, Matt wrote: > Ok. It works know. I was stuck to the last two lines. I defined > is_system_missing::Cint > is_considered_missing::Cint. > > instead of an UInt8 > > A last question: I actually have the structure itself as an argument, not a >

[julia-users] Re: C wrapper ReadStat : read files from Stata, SPSS and SAS.

2015-10-12 Thread Matt
Ok. It works know. I was stuck to the last two lines. I defined is_system_missing::Cint is_considered_missing::Cint. instead of an UInt8 A last question: I actually have the structure itself as an argument, not a pointer to the structure. Is the best way to convert v.union to the right type

[julia-users] Re: C wrapper ReadStat : read files from Stata, SPSS and SAS.

2015-10-12 Thread Steven G. Johnson
On Monday, October 12, 2015 at 6:46:51 PM UTC-4, Matt wrote: > > Ok. It works know. I was stuck to the last two lines. I defined > is_system_missing::Cint > is_considered_missing::Cint. > > instead of an UInt8 > That's incorrect. In the original C code you quoted, those to fields were

Re: [julia-users] Re: C wrapper ReadStat : read files from Stata, SPSS and SAS.

2015-10-12 Thread Matt
I ended up doing convert(Float32, reinterpret(Float64, x)), which does the job. I don't really know what the difference is (& I don't really know how to worry about endianess) Anyway, thanks everyone, it works ; I guess this post is now an [ANN] that you can import Stata, SPSS and SAS files

[julia-users] Re: C wrapper ReadStat : read files from Stata, SPSS and SAS.

2015-10-12 Thread Matt
Thanks for the explanation! :1 was not really googleable;) On Monday, October 12, 2015 at 8:36:57 PM UTC-4, Steven G. Johnson wrote: > On Monday, October 12, 2015 at 6:46:51 PM UTC-4, Matt wrote: > Ok. It works know. I was stuck to the last two lines. I definedĀ  > is_system_missing::Cint >

Re: [julia-users] Re: C wrapper ReadStat : read files from Stata, SPSS and SAS.

2015-10-12 Thread Matt
What to use instead of pointer_from_objecf? reinterpret(Int32, Int64(10)) gives ERROR: box: argument is of incorrect size in reinterpret at essentials.jl:115 On Monday, October 12, 2015 at 6:52:12 PM UTC-4, Yichao Yu wrote: > > On Mon, Oct 12, 2015 at 6:46 PM, Matt

Re: [julia-users] Re: C wrapper ReadStat : read files from Stata, SPSS and SAS.

2015-10-12 Thread Yichao Yu
On Mon, Oct 12, 2015 at 7:12 PM, Matt wrote: > What to use instead of pointer_from_objecf? > > > reinterpret(Int32, Int64(10)) > > gives > > ERROR: box: argument is of incorrect size > > > in reinterpret at essentials.jl:115 > That's why I said > Cast to a

[julia-users] Re: C wrapper ReadStat : read files from Stata, SPSS and SAS.

2015-10-12 Thread Steven G. Johnson
(I'm so spoiled by github, where I can post and then go back and correct all of my typos. I need to proofread more carefully on here.)