updateMaster: Update the master file

Description Usage Arguments Examples

Description

Update the master file

Usage

1
2
updateMaster(masterFile, fromFile, toFile, id = "email", dateRange = c(0,
  Inf), newIdOnly = FALSE, newIdFile)

Arguments

masterFile

a data frame or a path of the master file

fromFile

a list of data frames or paths of the input datasets

toFile

a string path of the updated master file

id

a string of variable is used as id variable. By default, id variable is email.

dateRange

a vector of lower and upper bound of dates that are selected from the input file.

newIdOnly

a logical variable to indicate whether or not to update only new IDs.

newIdFile

a string of the path that contains new IDs.

Examples

1
2
3
4
5
6
masterFile <- read.csv("../Variables/email.csv", stringsAsFactors = FALSE)

fromFileList <- paste0("../Variables/", list.files("../Variables/")[!grepl("email.csv", list.files("../Variables"))])
updateMaster(masterFile, as.list(fromFileList), "../Canada master file.csv")
masterFile <- masterFile[-sample(1:nrow(masterFile), 200), ]
updateMaster(masterFile, fromFileList, "../Canada master file2.csv", newIdOnly = TRUE, newIdFile = "../Variables/email.csv")

uyenhoang/panelmanager documentation built on May 3, 2019, 2:41 p.m.