R/create_log_dataframe.R

Defines functions create_log_dataframe

Documented in create_log_dataframe

#' Create Log Dataframe
#'
#' By default, this function will return a dataframe with the following variables: LOAD_TIMESTAMP, PARENT_FN,SOURCE_COMMENTS,FN,FN_MD5SUM, LOG_ID = "00",ROBJ_NAME,RDATA_FN, RDATA_FN_MD5SUM,LOG_TIMESTAMP, LOG_COMMENT)
#' @importFrom magrittr %>%
#' @importFrom dplyr mutate_all
#' @export


create_log_dataframe <-
        function() {
                return(
                        data.frame(PROJECT_LOG_DIR                 = "",
                                   PROJECT_LOG_LOAD_TIMESTAMP      = "", #timestamp from when file was moved from NEW to LOADED folders
                                   PROJECT_LOG_LOAD_COMMENT        = "", #any comments at load that are not supplied by the other columns
                                   PROJECT_LOG_PARENT_FN           = "", #if a parent file, typically an xlsx with tabs, is broken up into csvs
                                   PROJECT_LOG_SOURCE_COMMENT     = "", #any comments related to where this file originated
                                   PROJECT_LOG_FN                  = "", #file name
                                   PROJECT_LOG_FN_MD5SUM           = "",
                                   PROJECT_LOG_ID              = "00",
                                   PROJECT_LOG_ROBJ_NAME           = "",
                                   PROJECT_LOG_RDATA_FN            = "",
                                   PROJECT_LOG_RDATA_FN_MD5SUM     = "",
                                   PROJECT_LOG_TIMESTAMP       = "",
                                   PROJECT_LOG_COMMENT         = "",
                                   PROJECT_LOG_WRITE_TIMESTAMP     = "", #timestamp at which an output was written to local
                                   PROJECT_LOG_WRITE_COMMENT       = "",
                                   PROJECT_LOG_WRITE_FULL_FN       = "",  #full path to output file (especially since various destination folders)
                                   PROJECT_LOG_WRITE_FULL_FN_MD5SUM = "",
                                   PROJECT_LOG_GSHEET_KEY = "",
                                   PROJECT_LOG_GSHEET_TITLE = "",
                                   PROJECT_LOG_GSHEET_TAB_NAME = "",
                                   PROJECT_LOG_TO_DB_TIMESTAMP      = "",
                                   PROJECT_LOG_TO_DB_COMMENT        = "",
                                   PROJECT_LOG_TO_DB_NAME           = "",
                                   PROJECT_LOG_TO_DB_SCHEMA         = "",
                                   PROJECT_LOG_TO_DB_TABLE          = "",
                                   PROJECT_LOG_FROM_DB_TIMESTAMP      = "",
                                   PROJECT_LOG_FROM_DB_COMMENT        = "",
                                   PROJECT_LOG_FROM_DB_NAME           = "",
                                   PROJECT_LOG_FROM_DB_SCHEMA         = "",
                                   PROJECT_LOG_FROM_DB_TABLE          = "") %>%
                                dplyr::mutate_all(as.character) %>%
                                dplyr::mutate_all(trimws, "both")
                )
        }
patelm9/projectloggeR documentation built on Nov. 4, 2019, 11:21 p.m.