getFields: Get Field Info in SAS File

Description Usage Arguments Value Note Examples

View source: R/getFields.R

Description

The NCDB data comes with a .sas file that helps SAS users. Here getFields() parses that .sas file to create a tibble with information about field start and stop postions and factor levels. This tibble is then the input into pickFields().

Usage

1
getFields(year = 2016)

Arguments

year

year of NCDB data files (only 2016 supported)

Value

Tibble with short names (nms, which contain lower case letters if shortened), medium-sized names (names, all caps, default in .sas file), long names [labs, which get mapped to column object attributes in the output of mkNCDB()], and a list column Levs where factor rows contain tibbles whose n column holds factor numbers and val column holds string labels to which they map.

Note

The 2013 sas file needed manual editing to remove foreign characters at lines 548, 660-662, and 698. Use library(tools); showNonASCIIfile() to nonascii of 2016 file. Fixed versions are in the ‘extdata’ folder. Inspired by a function of the same name in SEERaBomb.

Examples

1
2
3
4
## Not run: 
library(NCDBR) 
getFields() 
## End(Not run)

SophiaJia/NCDBR documentation built on May 29, 2019, 12:36 p.m.