-
Notifications
You must be signed in to change notification settings - Fork 39
/
dataExportUtils.R
18 lines (15 loc) · 744 Bytes
/
dataExportUtils.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Title : Utilities to export data tables to CSV files.
# Objective : Persist data tables into format that can be used by researchers.
# Created by: pablocc
# Created on: 27/01/2021
library(data.table)
source("./fileSystemUtilities.R")
#' Persist stats data table into target path and file destination.
#' @param symbolID Asset symbol ID the stats are calculated for.
#' @param dataTable The data table to persist.
#' @param targetFileName The destination file name without extension.
dataTableStatsExport <- function(symbolID, dataTable, targetFileName) {
targetFileName <- paste0(statsDataDestinationPath(symbolID), targetFileName, ".csv")
fwrite(dataTable, targetFileName)
cat("Stats table exported to:", targetFileName, "\n")
}