Skip to contents

Functions to facilitate formatting and combining CSV transaction data downloaded from the Rostido website.

as_rostido() reformats a data frame containing downloaded Rostido Bank transaction data.

Usage

as_rostido(data, dateformat = "%d/%m/%Y")

# S3 method for class 'rostido'
rbind(..., .arrange_by = NULL)

# S3 method for class 'rostido'
print(x, ..., .include = NULL, maxwidth = 65L)

Arguments

data

data frame, as returned by read_rostido_csv().

dateformat

character string, passed as the format argument to as.Date(); default "%d/%m/%Y".

...

for rbind() S3 method for class "rostido", data frames of class "rostido" to be combined.

for print() S3 method for class "rostido", further arguments passed to or from other methods.

.arrange_by

a list of expressions containing names of column(s) for sorting rows of the combined "rostido" data frame e.g., exprs(Account, Code, desc(Amount)). Use desc() to sort a variable in descending order; default NULL.

x

an object used to select a method.

.include

<tidy-select> names of variables to be included or excluded when printing a "rostido" data frame containing Rostido Bank transaction data; default NULL.

maxwidth

an integer, maximum width for printing Description field; default 65L.

Value

as_rostido()

An object of class "rostido" inheriting from "data.frame" containing reformatted Rostido Bank transaction data.

Details

as_rostido() reformats a data frame containing Rostido Bank transaction data obtained using read_rostido_csv(), replacing character strings in the Date field with "Date" objects, and those in the Amount and Balance fields with numeric values.

By default, if no .arrange_by argument is specified, the rbind() S3 method for class "rostido" sorts the results by Date, AccountNo and Code.

By default, if no .include argument is specified, the print() S3 method for class "rostido" excludes the SortCode and ChequeNo columns from the printed output.

See also

Examples


if (FALSE) { # \dontrun{
   dnldpath <- "~/Rostido Bank/Downloads"

   ## __________________________
   ## Current account 55545372

   (curacc <- file.path(dnldpath, 55545372) |>
       most_recent_fname() |>
       read_rostido_csv() |>
       as_rostido())

   ## __________________________
   ## Savings account 55596784

   (savacc <- file.path(dnldpath, 55596784) |>
       most_recent_fname() |>
       read_rostido_csv() |>
       as_rostido())

   savacc |> print(.include = c(Description, Code, Amount, Balance))

   ## ______________
   ## All accounts

   rbind(curacc, savacc) ## default sort is by Date, AccountNo and Code.
   rbind(curacc, savacc, .arrange_by = exprs(AccountNo, Date, Code))
   rbind(curacc, savacc, .arrange_by = exprs(desc(Amount)))
   rbind(curacc, savacc, .arrange_by = exprs(Code, desc(Amount)))

   rm(curacc, savacc)
} # }