Skip to content

Allow either DataValues or Missings for representing missing data #34

@dmbates

Description

@dmbates

@davidanthoff I wanted to run this by you before preparing a PR.

I think it should be possible to represent missing data values in the result using either the DataValues package or the Missings package. Suppose that all the read_* functions had an optional Bool argument to control this choice with its value being stored in the ReadStatDataFrame. The handle_variable! function then ends with

    push!(ds.data, ds.useMissings ? fill(Union{jtype, Missing}(missing), ds.rows) : DataValueVector{ds.rows))

I think the only additional changes would be to use

dest::Union{DataValueVector{T}, Vector{Union{Missing,T}}}

in the signature of the readfield! methods and to add the Missings package.

Shall I prepare a PR for your consideration?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions