schedule | R Documentation |
Class providing an object to manipulate a schedule in a FR Y-9c
Class providing an object to manipulate a schedule in a FR Y-9c
Schedule(desig, title)
desig |
the designator of the schedule, e.g. "HI" |
title |
the title of the schedule |
an object of class schedule
new()
Initialize an object
.schedule$new(desig, title)
desig
the designator of the schedule, e.g. "HI"
title
the title of the schedule
initializeData()
initialize the values in each schedule
.schedule$initializeData(dat)
dat
A dataset from the Fed with all FR Y-9c data for a quarter. The dataset contains columns with names that correspond to key
s
add()
add a component
to this schedule
.schedule$add(comp)
comp
a component
export_csv()
export this schedule
in CSV format
.schedule$export_csv()
print()
print the schedule
as a string
.schedule$print()
getMetricFrom()
Get metric from key or num
.schedule$getMetricFrom(key, num = NA, metric = .metric$value)
key
The lookup key associated with the line item number
num
The line item number of a component of a schedule
metric
the metric
getComponentFrom()
get component from key and num
.schedule$getComponentFrom(key, num = NA)
key
The lookup key associated with the line item number
num
The line item number of a component of a schedule
getValueFromKey()
get a component
value from this object or a sub-component
that matches the key
.schedule$getValueFromKey(key)
key
The lookup key associated with the line item number
getNumFromKey()
get num from key
.schedule$getNumFromKey(key)
key
The lookup key associated with the line item number
getKeyFromNum()
get key from num
.schedule$getKeyFromNum(num)
num
The line item number of a component of a schedule
getValueFromNum()
get a component
value from the component
number in this object or a sub-component
.schedule$getValueFromNum(num)
num
The line item number of a component of a schedule
getCommonSizeValueFromNum()
get a component
common-sized value from the component
number in this object or a sub-component
.schedule$getCommonSizeValueFromNum(num)
num
The line item number of a component of a schedule
getCommonSizeValueFromKey()
get a component
common-sized value from the component
key
in this object or a sub-component
.schedule$getCommonSizeValueFromKey(key)
key
The lookup key associated with the line item number
getComponentFromKey()
get component from key
.schedule$getComponentFromKey(key)
key
The lookup key associated with the line item number
sumLevels()
add or subtract the component
s in this schedule
.schedule$sumLevels(pos_num_list, neg_num_list)
pos_num_list
a vector of component
num
s to be added
neg_num_list
a vector of component
num
s to be subtracted
getDesig()
get the desig
for this object
.schedule$getDesig()
getTitle()
get the title
for this object
.schedule$getTitle()
getBankNames()
get the bank_names
assigned to this object
.schedule$getBankNames()
addBankNames()
add bank_names
to this object
.schedule$addBankNames(bank_names)
bank_names
a vector of bank names to be stored in the schedule
createDataFrame()
create a data.frame
from the component
s in this object
.schedule$createDataFrame()
getComponent()
get a component
by its index in the schedule
.schedule$getComponent(index)
index
the index of the component
commonSize()
common-size the component
s in this schedule
using the divisor
.schedule$commonSize(divisor)
divisor
common size divisor
clone()
The objects of this class are cloneable with this method.
.schedule$clone(deep = FALSE)
deep
Whether to make a deep clone.
x <- Schedule("HI", "Income Statement") y <- Component("1.a.", "Income", "ZZZZ1234") y$add(Component("1.a.(1)", "Sub-Income", "ABCD5555")) x$add(y) x$initializeData(data.frame(ZZZZ1234 = 1:4, ABCD5555 = 5:8)) x$addBankNames(paste("bank", LETTERS[1:4], sep="")) all(x$export_csv() == c("Schedule HI, Income Statement, ", "1.a., Income, 1,2,3,4", "1.a.(1), Sub-Income, 5,6,7,8")) print(x) all(x$getValueFromKey("ABCD5555") == 5:8) all(x$getValueFromNum("1.a.") == 1:4) x$getDesig() == "HI" x$getTitle() == "Income Statement" all(x$getBankNames() == paste("bank", LETTERS[1:4], sep="")) x$getComponent(1)$getKey() == "ZZZZ1234" all(x$sumLevels(c("1.a.", "1.a.(1)"), NA) == 1:4 + 5:8) all(x$sumLevels("1.a.", "1.a.(1)") == 1:4 - 5:8) all(x$createDataFrame()$bankA == c(1,5)) x$commonSize(100) all.equal(x$getCommonSizeValueFromNum("1.a."), (1:4)/100) all.equal(x$getCommonSizeValueFromKey("ZZZZ1234"), (1:4)/100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.