Skip to content

Allow either DataValues or Missings for representing missing data #34

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions