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

Description Usage Arguments Format Value Fields Methods Examples

Description

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

Usage

1
2
3
4
5
6
.fry9c_group

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

Format

R6Class object.

Value

Object of R6Class

an object of class fry9c_group

the number of fry9c objects in the group

Fields

fry9c_list

a list of FR Y-9c objects

years

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

quarters

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

Methods

Documentation
new(years, quarters)

Creates object of this class with room for FR Y-9cs associated with each year adn quarter

parse_fry9c(files)

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

initializeData(data_list, banks)

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.

get_fry9c(year, quarter)

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

commonSize(divisor_sched, divisor_key, sched)

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.

get_plot_data(sched, key)

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

length()

Return the number of fry9c objects in the collection

print()

Print a summary of the collection contents

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# 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 May 13, 2019, 5:22 p.m.