Skip to content

Issue with some labels not applied when reading SAS #529

@jacciz

Description

@jacciz

I'm reading a SAS database into R using our format file. I see the labels are applied to only some of the columns. In SAS, I see the format is applied to each column, just fine, so I'm not sure why the catalog file is not working when reading into R.

I put a sample of the database and format file here

Here's an example of two columns; one labels are not applied, one labels are applied.

test <- read_sas("person18.sas7bdat", "format17.sas7bcat")

attributes(test$ROLE) # labels are not applied
#> $format.sas
#> [1] "F17ROLE"
attributes(test$SFTYEQP) # labels are applied
#> $format.sas
#> [1] "F17SFTYEQP"
#> 
#> $class
#> [1] "haven_labelled"
#> 
#> $labels
#>                     Shoulder & Lap Belt                           Lap Belt Only 
#>                                     101                                     102 
#>                      Shoulder Belt Only                   Restraint Use Unknown 
#>                                     103                                     104 
#>            None Used - Vehicle Occupant           Restraint Used - Type Unknown 
#>                                     105                                     106 
#> Child Restraint System - Forward Facing    Child Restraint System - Rear Facing 
#>                                     107                                     108 
#>                            Booster Seat          Child Restraint - Type Unknown 
#>                                     109                                     110 
#>                          Not Applicable                                   Other 
#>                                     990                                     998

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorreadstat

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions