Read_csv: Read_csv

Description Usage Arguments Details Value See Also Examples

View source: R/Read_csv.R

Description

This function is used to read a csv file and create a Transactions object from it. This object contains the transactions in a standardized form and information about the reference account.

Usage

1
2
3
Read_csv(ref, fileName, columns, db, head = TRUE, colSep = "\t",
  decSep = ",", quoteChar = "\"", commentChar = "", nSkip = 0,
  nMax = -1, dateFormat = "%d.%m.%Y")

Arguments

ref

chr for the type of the reference account of the uploaded file

fileName

chr for the file to be read (should be a csv)

columns

list which defines which columns of the read table (from file) contain which information: It must specify name, iban, bic, date, reference, entry, value, currency as list elements in this order, with their according columns in the table as int values.

db

chr the database used / file name and path of database

head

bool (=TRUE) whether the first line of the file defines column names of the table

colSep

chr (="\t") seperator for columns in the table

decSep

chr (=",") decimal seperator for numbers

quoteChar

chr (="\"") symbol used for quotes in table

commentChar

chr (="") symbol introducing comments in the table

nSkip

int (=0) how many lines to skip when reading the file (from top to bottom)

nMax

int (=-1) maximum number of lines the read (negative to read all lines of file)

dateFormat

chr (="%d.%m.%Y" for"13.03.1990") date format to use for converting the date column

Details

  1. reference account information is retrieved from the database

  2. file is read as a table as specified in arguments

  3. table is converted as specified with arguments columns and dateFormat

  4. Transactions object is returned

Value

Transactions object which is a list of 3 elements:

See Also

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

Examples

1
2
3
4
5
6
7
db <- "test.db"
Create_testDB(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)

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