Enter.Transactions: Enter.Transactions

Description Usage Arguments Details Value See Also Examples

View source: R/Enter.R

Description

This function uses a Transactions object as created with Duplicated.Transactions and inserts it into the transactions table of the database. The Prediction list object is used for this. Transactions marked as duplicated are not entered. This can be controlled with the bool column of the Duplicated list element.

Usage

1
2
## S3 method for class 'Transactions'
Enter(x)

Arguments

x

Transactions object (created with Duplicated.Transactions)

Details

  1. Duplicated rows as indicated by the bool column of the eponymous list element are removed

  2. Columns are adjusted to database table

  3. Correct formatting of columns is ensured

  4. Data is inserted into transactions table of database

Value

TRUE

See Also

Other procedures: Duplicated.Transactions, Duplicated, Enter, Evaluate_Predictor, Predict.Transactions, Predict, Read.Transactions, Read_csv, Read, Update_Predictor

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
db <- "test.db"
Create_testDB(db)

params <- list(
  nFeats = 200, 
  DDL = FALSE, 
  time = list(start = as.Date("2010-1-1"), end = as.Date("2011-1-1"))
)
InsertBLOB("Params", params, db)
Update_Predictor(db)

f <- system.file("extdata", "test_transactions.csv", package = "abacus")
cols <- list(name = 6, iban = 7, bic = 8, date = 3, 
             reference = 5, entry = 4, value = 9, currency = 10)
tas <- Read_csv("giro", f, cols, db)
tas <- Read(tas)
tas$NewAccounts$owner[3] <- "New Owner 3"
tas <- Predict(tas)

tas <- Duplicated(tas)
m <- cbind(tas$Prediction,tas$Duplicated)
names(m)[15:16] <- c("exists in db", "with type")
DT::datatable(m)

Enter(tas)

mRcSchwering/abacus documentation built on May 21, 2019, 9:18 a.m.