#' @import fst
setClass("CombinedData", contains = "data.table",
slots = list(Acquisitions.path="character", Last_Performance.path="character"))
CombinedData <- function(Acquisitions.path, Last_Performance.path) {
browser()
stopifnot(file.exists(Acquisitions.path), file.exists(Last_Performance.path))
# Data_A.fst_table <- fst[Acquisitions.path]
# Last_P.fst_table <- fst[Last_Performance.path]
Data_A <- read_fst(Acquisitions.path, columns = c('LOAN_ID', 'ORIG_DTE', 'ORIG_AMT'), as.data.table = TRUE)
Last_P <- read_fst(Last_Performance.path, columns = c('LOAN_ID', 'last_upb'), as.data.table = TRUE)
Combined_Data <- merge(Data_A, Last_P)
new("CombinedData", Combined_Data, Acquisitions.path=Acquisitions.path, Last_Performance.path=Last_Performance.path)
}
#' show CombinedData
#'
#' show CombinedData data set
#'
#' @param object CombinedData
#'
#' @export
#'
setMethod("show", signature(object = "CombinedData"), function(object) {
str(object, list.len=999)
# print(asS3(object))
print(metadata_fst(object@file_fst ))
# print(summary(object))
callNextMethod()
})
#' aggregate CombinedData
#'
#' @param x CombinedData object
#' @param ... not used
#'
#' @return A data.table
#' @export
#'
setMethod("aggregate", signature(x = "CombinedData"), function(x,...) {
aggregate.Combined_Data(x)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.