Skip to contents

Flag non-Scottish residents

Usage

flag_non_scottish_residents(data, slf_pc_lookup)

Arguments

data

An SLF individual file.

slf_pc_lookup

The Source postcode lookup, defaults to get_slf_postcode_path() read using read_file().

Value

A data frame with the variable 'keep_flag'

Details

The variable keep flag can be in the range c(0:4) where

  • keep_flag = 0 when resident is Scottish

  • keep_flag = 1 when resident is not Scottish

  • keep_flag = 2 when the postcode is missing or a dummy, and the gpprac is missing

  • keep_flag = 3 when the gpprac is not English and the postcode is missing

  • keep_flag = 4 when the gpprac is not English and the postcode is a dummy

The intention is to only keep the records where keep_flag = 0