Skip to content

read_sas does not handle special missing numeric variables #474

@RaymondBalise

Description

@RaymondBalise

read_sas silently sets all of the different kinds of missing SAS values to the generic R NA. So I can't use the *_tagged_na function in haven without manually recoding them.

Is it possible to add an option to convert .A through .Z to other values or mark them appropriately with the haven *_tagged_na functions?

This would be wildly helpful for people who are dealing with data that is not missing at random (missing because someone failed to show up for drug screening is very different than the lab tech dropped the sample).

Unfortunately you need SAS for this reprex:

data "c:\blah\blah.sas7bdat";
input a b;
datalines;
1 .a
2 .b
27 .
28 1
;
run;

read_sas does not import missing numeric values from SAS.

library(haven)
read_sas("c://blah//blah.sas7bdat")

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