| component | R Documentation | 
Class providing an object to manipulate a component of a schedule in a FR Y-9c
Class providing an object to manipulate a component of a schedule in a FR Y-9c
Component(num, name, key)
| num | The line item number of a component of a schedule | 
| name | The name of the line item number | 
| key | The lookup key associated with the line item number | 
an object of class component
new()initialize the values in each component
.component$new(num, name, key)
numThe line item number of a component of a schedule
nameThe name of the line item number
keyThe lookup key associated with the line item number
initializeData()initialize object with data
.component$initializeData(dat)
datA dataset from the Fed with all FR Y-9c data for a quarter.  The dataset contains columns with names that correspond to keys
add()add a sub-component to this component
.component$add(comp)
compa component
export_csv()export this component in CSV format
.component$export_csv()
print()print the component as a string
.component$print()
getMetricFrom()get a metric
.component$getMetricFrom(key, num = NA, metric = .metric$value)
keyThe lookup key associated with the line item number
numThe line item number of a component of a schedule
metricthe metric name
getValueFromKey()get a component value from this object or a sub-component that matches the key
.component$getValueFromKey(key)
keyThe lookup key associated with the line item number
getValueFromNum()get a component value from the component number in this object or a sub-component
.component$getValueFromNum(num)
numThe line item number of a component of a schedule
getNumFromKey()Get a num from a key
.component$getNumFromKey(key)
keyThe lookup key associated with the line item number
getKeyFromNum()get a key from a num
.component$getKeyFromNum(num)
numThe 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
.component$getCommonSizeValueFromNum(num)
numThe 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
.component$getCommonSizeValueFromKey(key)
keyThe lookup key associated with the line item number
getComponentFrom()get a Component
.component$getComponentFrom(key, num = NA)
keyThe lookup key associated with the line item number
numThe line item number of a component of a schedule
getComponentFromKey()Get a component from a key
.component$getComponentFromKey(key)
keyThe lookup key associated with the line item number
getComponentFromNum()Get a component from a key
.component$getComponentFromNum(num)
numThe line item number of a component of a schedule
getValue()get the value of this object
.component$getValue()
getCommonSizeValue()get the common-sized value of this object
.component$getCommonSizeValue()
getKey()get the key from this object
.component$getKey()
getNum()get the num from this object
.component$getNum()
getName()get the name from this object
.component$getName()
getAllValues()get the values from this object and all sub-components
.component$getAllValues()
getAllNums()get all the nums from this object and all sub-components
.component$getAllNums()
getAllNames()get all the names from this object and all sub-components
.component$getAllNames()
commonSize()common-size this component using the divisor
.component$commonSize(divisor)
divisora numeric that a component's values are divided by
clone()The objects of this class are cloneable with this method.
.component$clone(deep = FALSE)
deepWhether to make a deep clone.
x <- Component("1.a.", "Income", "ZZZZ1234")
x$add(Component("1.a.(1)", "Sub-Income", "ABCD5555"))
x$initializeData(data.frame(ZZZZ1234 = 1:4,
                            ABCD5555 = 5:8))
x$export_csv()[1] == "1.a., Income, 1,2,3,4"
print(x)
all(x$getValueFromKey("ABCD5555") == 5:8)
all(x$getValueFromNum("1.a.") == 1:4)
all(x$getValue() == 1:4)
x$getKey() == "ZZZZ1234"
x$getNum() == "1.a."
x$getName() == "Income"
all(unlist(x$getAllValues()) == 1:8)
all(unlist(x$getAllNums()) == c("1.a.", "1.a.(1)"))
all(unlist(x$getAllNames() == c("Income", "Sub-Income")))
x$commonSize(100)
all.equal(x$getCommonSizeValueFromNum("1.a."), (1:4)/100)
all.equal(x$getCommonSizeValueFromKey("ZZZZ1234"), (1:4)/100)
all.equal(x$getCommonSizeValue(), (1:4)/100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.