pos_names_extract: Process a Provider of Services Record Layour file to extract...

Description Usage Arguments Details Value Examples

View source: R/pos_names_extract.R

Description

This function takes a Provider of Services Record Layout file (in .txt form) and parses it to extract the descriptive variable names instead of generic ones. For example, the 2006 file variable PROV0085, which is the name of the variable in the raw dataset downloaded from CMS, has a more descriptive name in the layout file: CATEGORY-SUBTYPE-IND.

Usage

1
pos_names_extract(layout_file, data_file)

Arguments

layout_file

The file location of the layout file

data_file

The year's data file

Details

This uses regular expressions to find variable names. It works with years 2000-2010. Later years seem to have descriptive names already, though they aren't necessarily identical across years (nor do they match the names produced here). This code can be run to produce variable names fresh, but pre-computed variable names can also be accessed by names_pos_20XX() functions also in this package.

Value

A vector of names, ordered to match the corresponding year's data file

Examples

1
2
3
4
## Not run: 
pos_names_extract("pos_2006_layout.txt", pos_2006_data)

## End(Not run)

robertgambrel/medicare documentation built on May 27, 2019, 10:32 a.m.