Please don’t conflate NaN and NA. You should _never_ use NaN unless you’re 
working with an Array, not a DataArray.

 — John

On Sep 24, 2014, at 7:48 AM, muraveill <murave...@gmail.com> wrote:

> @data([NaN]) already correctly returns DataArray(Float64, 1). If people mix 
> NA's inside, it should return an Any type.
> 
> The problem is when it comes from data that is all NA in some parts, like 
> results of statistical tests with zero variance etc., and you want 
> @data(subset_of_the_data). But stats package should return NaN's instead of 
> NA's. And if NA's are already in the file (as text), like in R one should be 
> able to decide what string will be converted to NA (by default, "NA"), and 
> what is converted to NaN (default "NaN").
> 
> Maybe the OP wanted to use NaN instead.
> 
> On Wednesday, 24 September 2014 16:32:04 UTC+2, John Myles White wrote:
> I think that DataArray{Any, 1} is probably the best thing you could possibly 
> do.
> 
> But it’s still going to cause people lots of problems, because there’s almost 
> never a time when you’d want to work with DataArray{Any, 1}.
> 
> At some point, we have to improve the @data macro.
> 
> But for this use case, I suspect people are much better off using
> 
> DataArray(Float64, 1)
> 
> or something similar to produce an all-NA array of type T and size S.
> 
>  — John
> 
> On Sep 24, 2014, at 7:29 AM, muraveill <mura...@gmail.com> wrote:
> 
>> I was about to say DataArray{NAtype,1}. But then the type cannot be changed 
>> according to what is added to it, right ?
>> Then DataArray{Any,1}. Just as @data(["asdf" NA; NA 1.4]).
>> 
>> On Wednesday, 24 September 2014 16:25:17 UTC+2, John Myles White wrote:
>> Naivete isn’t a big deal. Just try to be very precise. Any literal in Julia 
>> should produce a value V of type T. 
>> 
>> What’s the type T that @data([NA]) would produce? 
>> 
>>  — John 
>> 
>> On Sep 24, 2014, at 7:22 AM, muraveill <mura...@gmail.com> wrote: 
>> 
>> > To my naive view, a data array with cells containing ony value NA. Well, 
>> > it works with numbers, why not NA. The error thrown is the same in two 
>> > dimensions with arrays of length > 1. 
>> 
> 

Reply via email to