Le mercredi 21 mai 2014 à 00:30 -0700, Ivar Nesje a écrit : > This seems to be a consequence of the promote_rule for NA, as defined > in > > > > https://github.com/JuliaStats/DataArrays.jl/blob/fc8a8a1f7713c61c76a3562f17fba8c0d193c82b/src/natype.jl#L36-L37 > > > > It even has a TODO comment, so it is obvious that the author did not > like his solution, but had some reason to define NA to promote to any > type you combine it with. > I'm not sure what this rule should be, but the current choice is > definitely bad for concatenation of elements to an array. I guess the idea was that you usually don't want [1, 2, NA] to be promoted to Any, which would be very inefficient. So better get an error in that case so you'll eventually find out you need to do @data [1, 2, NA] to get a DataArray.
But I think the real solution would be to do the correct conversion to a DataArray automatically: https://groups.google.com/d/msg/julia-stats/1CYmgu1Lye0/bjJxcEssXt4J Regards
