combine_scanner_data: Function to combine Nielsen scanner data.

Description Usage Arguments

View source: R/combine_scanner_data.R

Description

This function combines year-level Nielsen data cross years, keeping only a subset of stores specified by the user. The user also specifies for which years he would like the data.

Usage

1
2
3
4
combine_scanner_data(folder = NULL, file_tail, file_type, years,
  filters = NULL, store_info_folder = folder,
  store_info_prefix = "stores_", store_info_filetype = file_type,
  select_modules = F, modules_data = NULL)

Arguments

folder

The folder in which the scanner data and the year-level store information are contained (if they aren't in the working directory) (character).

file_tail

The name of the scanner data files (that follows the year). For example, if the 2010 file was called 2010_scanner_data.dta, the file_stem argument would be "_scanner_data". (character)

file_type

The type of the file. Currently works for either .dta, .csv, and .txt files. (character)

years

A vector of years for which the scanner data should be returned (numeric).

filters

A string containing the filtering conditions (e.g., if I wanted to keep stores in fips_state == 4 and fips_county == 18, it would be "fips_state == 4 & fips_county == 18") (character)

store_info_folder

The folder containing the store information files, if different than folder. (character)

store_info_prefix

The prefix for the store information files. (character)

store_info_filetype

The filetype of the store information files, if different than file_type. (character)

select_modules

Do you want to specify specific product modules to keep? (logical)

modules_data

If select_modules = TRUE, the dataset containing the modules to be kept (data.table)


johnnybonney/sales.taxes documentation built on Dec. 14, 2018, 3:03 p.m.