split_save: Export a single dataset into multiple files by group

Description Usage Arguments Examples

View source: R/split_save.R

Description

Export a single dataset into multiple files by group

Usage

1
split_save(df, group_var, folderpath, filename_stub, include_date = FALSE)

Arguments

df

dataframe to split

group_var

grouping variable to split the dataset by, eg operatingunit, fundingagency

folderpath

directory where you want to store the files

filename_stub

generic stub for naming all the files

include_date

include date after filenamestub? default = FALSE, eg "20180913"

Examples

1
2
3
4
5
6
7
8
## Not run: 
#create country specific files for TX_NEW
 df_mer %>%
  filter(indicator == "TX_NEW",
         standardizeddisaggregate == "Total Numerator") %>%
  split_save(operatingunit, "~/CountryFiles", "FY18Q3_TX")

## End(Not run)

ICPI/ICPIutilities documentation built on Aug. 30, 2021, 12:19 p.m.