fry9c_group: Class providing an object to manipulate a group of FR Y-9c...

fry9c_groupR Documentation

Class providing an object to manipulate a group of FR Y-9c templates, typically used to manage FY Y-9c across years

Description

Class providing an object to manipulate a group of FR Y-9c templates, typically used to manage FY Y-9c across years

Class providing an object to manipulate a group of FR Y-9c templates, typically used to manage FY Y-9c across years

Usage

Fry9c_group(years, quarters)

## S3 method for class 'fry9c_group'
length(x, ...)

Arguments

years

The years associated with the fry9c objects in the group

quarters

The quarters associate with the fry9c objects in the group

x

the fry9c_group object

...

not used

Value

an object of class fry9c_group

the number of fry9c objects in the group

Methods

Public methods


Method new()

Initialize

Usage
.fry9c_group$new(years, quarters)
Arguments
years

The year associated with FR Y-9c in the list

quarters

The quarter associated with each FR Y-9c in the list


Method parse_fry9c()

Parse a collection of files which each represent a FR Y-9c schema.

Usage
.fry9c_group$parse_fry9c(files)
Arguments
files

file names


Method initializeData()

Parse a collection of FR Y-9c data files in data_list. Also include a vector of banks that includes the names of the banks associated with the rows as they should appear in output.

Usage
.fry9c_group$initializeData(data_list, banks)
Arguments
data_list

list of data objects

banks

bank names


Method get_fry9c()

Extract a fry9c object from the collection associated with a year and quarter

Usage
.fry9c_group$get_fry9c(year, quarter)
Arguments
year

The year associated with FR Y-9c in the list

quarter

The quarter associated with each FR Y-9c in the list


Method get_fry9c_list()

Get a FRY-9C list

Usage
.fry9c_group$get_fry9c_list(years, quarters)
Arguments
years

The year associated with FR Y-9c in the list

quarters

The quarter associated with each FR Y-9c in the list


Method commonSize()

Common side the sched using the element from the divisor_sched and divisor_key. This is usually done by common sizing an income statement with the average assets.

Usage
.fry9c_group$commonSize(divisor_sched, divisor_key, sched)
Arguments
divisor_sched

the schedule of the divisor

divisor_key

the key of the divisor

sched

the schedule


Method get_plot_data()

Create a data.frame that can be used for plotting using ggplot2 by selecting a schedule sched and element number key

Usage
.fry9c_group$get_plot_data(sched, key, num = NA)
Arguments
sched

the schedule

key

the key in the schedule

num

the schedule element


Method length()

Return the number of fry9c objects in the collection

Usage
.fry9c_group$length()

Method print()

Print a summary of the collection contents

Usage
.fry9c_group$print()

Method clone()

The objects of this class are cloneable with this method.

Usage
.fry9c_group$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

# load example data
fry9c_data_list <- list(
  read.csv(system.file(file.path("extdata", "ex_BHCF1712.csv"), package = "fry9c")),
  read.csv(system.file(file.path("extdata", "ex_BHCF1812.csv"), package = "fry9c")))

my_fry9c_group <- Fry9c_group(years = c(2017, 2016),
                              quarters = c(4, 4))
my_fry9c_group$parse_fry9c(
  system.file(file.path("extdata", c("FR_Y-9C20171231.xml", "FR_Y-9C20161231.xml")),
              package = "fry9c"))

my_fry9c_group$initializeData(fry9c_data_list, paste("bank", LETTERS[1:10], sep=""))
print(my_fry9c_group)
length(my_fry9c_group) == 2

class(my_fry9c_group$get_fry9c(2016, 4))[1] == "fry9c"

my_fry9c_group$commonSize("HC-K", "BHCK3368", "HI") # 5.

nrow(my_fry9c_group$get_plot_data("HC-K", "BHCK3368")) == 20 # 5.

bertcarnell/fry9c documentation built on April 18, 2022, 10:05 p.m.