# Load packages
# Core
library(tidyverse)
library(tidyquant)
library(readr)
# Time series
library(lubridate)
library(tibbletime)
# modeling
library(broom)
Examine how each asset contributes to portfolio standard deviation. This is to ensure that our risk is not concentrated in any one asset.
five stocks: “SPY”, “EFA”, “IJS”, “EEM”, “AGG” from 2012-12-31 to 2017-12-31
symbols <- c("SPY", "EFA", "IJS", "EEM", "AGG")
prices <- tq_get(x = symbols,
get = "stock.prices",
from = "2012-12-31",
to = "2017-12-31")
asset_returns_tbl <- prices %>%
group_by(symbol) %>%
tq_transmute(select = adjusted,
mutate_fun = periodReturn,
period = "monthly",
type = "log") %>%
slice(-1) %>%
ungroup() %>%
set_names(c("asset", "date", "returns"))
Refresh your memory on covariance with this video. Click this link Refresh your memory on matrix multiplication. Click this link
# Transform data into wide form
asset_returns_wide_tbl <- asset_returns_tbl %>%
pivot_wider(names_from = asset, values_from = returns) %>%
column_to_rownames(var = "date")
asset_returns_wide_tbl
## AGG EEM EFA IJS SPY
## 2013-01-31 -0.0062307936 -0.002936100 0.0366062115 0.052133329 4.992259e-02
## 2013-02-28 0.0058905776 -0.023104980 -0.0129696830 0.016175759 1.267822e-02
## 2013-03-28 0.0009854156 -0.010235266 0.0129696830 0.040257260 3.726812e-02
## 2013-04-30 0.0096391921 0.012085052 0.0489675988 0.001222724 1.903040e-02
## 2013-05-31 -0.0202139631 -0.049483457 -0.0306556806 0.041976642 2.333478e-02
## 2013-06-28 -0.0157783155 -0.054728624 -0.0271443147 -0.001402978 -1.343397e-02
## 2013-07-31 0.0026876495 0.013160083 0.0518605032 0.063541369 5.038532e-02
## 2013-08-30 -0.0082984281 -0.025705848 -0.0197463255 -0.034743741 -3.045086e-02
## 2013-09-30 0.0111447045 0.069588879 0.0753384385 0.063873671 3.115616e-02
## 2013-10-31 0.0082914983 0.040861231 0.0320817322 0.034233996 4.526657e-02
## 2013-11-29 -0.0025103714 -0.002593820 0.0054496320 0.041661068 2.920711e-02
## 2013-12-31 -0.0055833941 -0.004074465 0.0215277240 0.012892367 2.559625e-02
## 2014-01-31 0.0152922387 -0.090323021 -0.0534129260 -0.035775250 -3.588527e-02
## 2014-02-28 0.0037573793 0.033220752 0.0595049112 0.045257305 4.451039e-02
## 2014-03-31 -0.0014819716 0.038021842 -0.0046024881 0.013315100 8.261911e-03
## 2014-04-30 0.0081832921 0.007772671 0.0165292830 -0.023184356 6.926967e-03
## 2014-05-30 0.0117216387 0.029091343 0.0158282964 0.006205509 2.294138e-02
## 2014-06-30 -0.0005757289 0.023733912 0.0091654735 0.037718570 2.043464e-02
## 2014-07-31 -0.0025123735 0.013555537 -0.0263797134 -0.052009174 -1.352867e-02
## 2014-08-29 0.0114310531 0.027904370 0.0018004513 0.043657629 3.870472e-02
## 2014-09-30 -0.0061673659 -0.080856301 -0.0395984360 -0.061260243 -1.389236e-02
## 2014-10-31 0.0105843529 0.014096237 -0.0026545818 0.068874807 2.327802e-02
## 2014-11-28 0.0065487477 -0.015541230 0.0006249829 0.004773641 2.710138e-02
## 2014-12-31 0.0014748417 -0.040442272 -0.0407467617 0.025295674 -2.539691e-03
## 2015-01-30 0.0203152277 -0.006895333 0.0062264486 -0.054627705 -3.007736e-02
## 2015-02-27 -0.0089874536 0.043135645 0.0614506302 0.056914796 5.468221e-02
## 2015-03-31 0.0037400749 -0.015085951 -0.0143883996 0.010156171 -1.583027e-02
## 2015-04-30 -0.0032330392 0.066281393 0.0358162407 -0.018417903 9.785600e-03
## 2015-05-29 -0.0043833244 -0.041911081 0.0019526270 0.007510260 1.277419e-02
## 2015-06-30 -0.0108258091 -0.029746812 -0.0316786936 0.004171290 -2.052112e-02
## 2015-07-31 0.0085845667 -0.065177911 0.0201142167 -0.027375501 2.233814e-02
## 2015-08-31 -0.0033635046 -0.092512275 -0.0771522762 -0.047268221 -6.288702e-02
## 2015-09-30 0.0080817044 -0.031825243 -0.0451948145 -0.038464762 -2.584725e-02
## 2015-10-30 0.0006848653 0.061808363 0.0640257723 0.063589797 8.163524e-02
## 2015-11-30 -0.0038986277 -0.025560385 -0.0075556617 0.024414858 3.648616e-03
## 2015-12-31 -0.0019190448 -0.038946936 -0.0235950923 -0.052156883 -1.743375e-02
## 2016-01-29 0.0123303593 -0.051636920 -0.0567579406 -0.060306856 -5.106899e-02
## 2016-02-29 0.0088319698 -0.008211499 -0.0339136892 0.020605259 -8.257876e-04
## 2016-03-31 0.0087087681 0.121878923 0.0637457309 0.089910528 6.510030e-02
## 2016-04-29 0.0025458859 0.004079345 0.0219752051 0.021044302 3.932912e-03
## 2016-05-31 0.0001357041 -0.037628548 -0.0008563037 0.004397156 1.686892e-02
## 2016-06-30 0.0191668646 0.044582476 -0.0244916223 0.008291854 3.469667e-03
## 2016-07-29 0.0054298730 0.052442012 0.0390002054 0.049348591 3.582174e-02
## 2016-08-31 -0.0021568992 0.008798525 0.0053270101 0.011261114 1.196910e-03
## 2016-09-30 0.0005158697 0.024873025 0.0132791830 0.008614564 5.799062e-05
## 2016-10-31 -0.0082052795 -0.008312354 -0.0224037071 -0.038135000 -1.748883e-02
## 2016-11-30 -0.0259892499 -0.045161759 -0.0179745848 0.125246532 3.617574e-02
## 2016-12-30 0.0025383724 -0.002529762 0.0267028073 0.031491924 2.006918e-02
## 2017-01-31 0.0021261899 0.064431261 0.0323820121 -0.012143994 1.773668e-02
## 2017-02-28 0.0064374388 0.017257862 0.0118364660 0.013428701 3.853909e-02
## 2017-03-31 -0.0005527735 0.036188966 0.0318055682 -0.006532919 1.249386e-03
## 2017-04-28 0.0090293927 0.016866422 0.0239522182 0.005107632 9.877036e-03
## 2017-05-31 0.0068475825 0.028059804 0.0348103046 -0.022862461 1.401440e-02
## 2017-06-30 -0.0001832239 0.009223562 0.0029558906 0.029151906 6.354424e-03
## 2017-07-31 0.0033348199 0.056594763 0.0261878297 0.007481283 2.034584e-02
## 2017-08-31 0.0093691216 0.023243854 -0.0004483498 -0.027564505 2.913453e-03
## 2017-09-29 -0.0057326254 -0.000446030 0.0233428154 0.082321661 1.994913e-02
## 2017-10-31 0.0009780530 0.032278265 0.0166538869 0.005915990 2.329061e-02
## 2017-11-30 -0.0014835961 -0.003897034 0.0068699458 0.036913237 3.010822e-02
## 2017-12-29 0.0047399617 0.036925439 0.0133982206 -0.003731176 1.205488e-02
# Covariance of asset returns
covariance_matrix <- cov(asset_returns_wide_tbl)
covariance_matrix
## AGG EEM EFA IJS SPY
## AGG 7.398449e-05 0.0001042094 0.0000417831 -7.811962e-05 -9.031444e-06
## EEM 1.042094e-04 0.0017547106 0.0010390168 6.437721e-04 6.795452e-04
## EFA 4.178310e-05 0.0010390168 0.0010642347 6.490300e-04 6.975410e-04
## IJS -7.811962e-05 0.0006437721 0.0006490300 1.565448e-03 8.290255e-04
## SPY -9.031444e-06 0.0006795452 0.0006975410 8.290255e-04 7.408310e-04
# Standard deviation of portfolio
# Summarizes how much each asset's returns vary with those of other assets within the portfolio into a single number
w <- c(0.25, 0.25, 0.2, 0.2, 0.1)
sd_portfolio <- sqrt(t(w) %*% covariance_matrix %*% w)
sd_portfolio
## [,1]
## [1,] 0.02347491
# Component contribution
# Similar to the formula for sd_portfolio
# Mathematical trick to summarize the same, sd_portfolio, by asset instead of a single number
component_contribution <- (t(w) %*% covariance_matrix * w) / sd_portfolio[1,1]
component_contribution
## AGG EEM EFA IJS SPY
## [1,] 0.000387414 0.009257143 0.005815631 0.005684464 0.002330253
rowSums(component_contribution)
## [1] 0.02347491
# Component contribution in percentage
component_percentages <- (component_contribution / sd_portfolio[1,1]) %>%
round(3) %>%
as_tibble()
component_percentages
## # A tibble: 1 × 5
## AGG EEM EFA IJS SPY
## <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 0.017 0.394 0.248 0.242 0.099
component_percentages %>%
as_tibble() %>%
gather(key = "asset", value = "contribution")
## # A tibble: 5 × 2
## asset contribution
## <chr> <dbl>
## 1 AGG 0.017
## 2 EEM 0.394
## 3 EFA 0.248
## 4 IJS 0.242
## 5 SPY 0.099
# Transform data into wide form
asset_returns_wide_tbl <- asset_returns_tbl %>%
pivot_wider(names_from = asset, values_from = returns) %>%
column_to_rownames(var = "date")
asset_returns_wide_tbl
## AGG EEM EFA IJS SPY
## 2013-01-31 -0.0062307936 -0.002936100 0.0366062115 0.052133329 4.992259e-02
## 2013-02-28 0.0058905776 -0.023104980 -0.0129696830 0.016175759 1.267822e-02
## 2013-03-28 0.0009854156 -0.010235266 0.0129696830 0.040257260 3.726812e-02
## 2013-04-30 0.0096391921 0.012085052 0.0489675988 0.001222724 1.903040e-02
## 2013-05-31 -0.0202139631 -0.049483457 -0.0306556806 0.041976642 2.333478e-02
## 2013-06-28 -0.0157783155 -0.054728624 -0.0271443147 -0.001402978 -1.343397e-02
## 2013-07-31 0.0026876495 0.013160083 0.0518605032 0.063541369 5.038532e-02
## 2013-08-30 -0.0082984281 -0.025705848 -0.0197463255 -0.034743741 -3.045086e-02
## 2013-09-30 0.0111447045 0.069588879 0.0753384385 0.063873671 3.115616e-02
## 2013-10-31 0.0082914983 0.040861231 0.0320817322 0.034233996 4.526657e-02
## 2013-11-29 -0.0025103714 -0.002593820 0.0054496320 0.041661068 2.920711e-02
## 2013-12-31 -0.0055833941 -0.004074465 0.0215277240 0.012892367 2.559625e-02
## 2014-01-31 0.0152922387 -0.090323021 -0.0534129260 -0.035775250 -3.588527e-02
## 2014-02-28 0.0037573793 0.033220752 0.0595049112 0.045257305 4.451039e-02
## 2014-03-31 -0.0014819716 0.038021842 -0.0046024881 0.013315100 8.261911e-03
## 2014-04-30 0.0081832921 0.007772671 0.0165292830 -0.023184356 6.926967e-03
## 2014-05-30 0.0117216387 0.029091343 0.0158282964 0.006205509 2.294138e-02
## 2014-06-30 -0.0005757289 0.023733912 0.0091654735 0.037718570 2.043464e-02
## 2014-07-31 -0.0025123735 0.013555537 -0.0263797134 -0.052009174 -1.352867e-02
## 2014-08-29 0.0114310531 0.027904370 0.0018004513 0.043657629 3.870472e-02
## 2014-09-30 -0.0061673659 -0.080856301 -0.0395984360 -0.061260243 -1.389236e-02
## 2014-10-31 0.0105843529 0.014096237 -0.0026545818 0.068874807 2.327802e-02
## 2014-11-28 0.0065487477 -0.015541230 0.0006249829 0.004773641 2.710138e-02
## 2014-12-31 0.0014748417 -0.040442272 -0.0407467617 0.025295674 -2.539691e-03
## 2015-01-30 0.0203152277 -0.006895333 0.0062264486 -0.054627705 -3.007736e-02
## 2015-02-27 -0.0089874536 0.043135645 0.0614506302 0.056914796 5.468221e-02
## 2015-03-31 0.0037400749 -0.015085951 -0.0143883996 0.010156171 -1.583027e-02
## 2015-04-30 -0.0032330392 0.066281393 0.0358162407 -0.018417903 9.785600e-03
## 2015-05-29 -0.0043833244 -0.041911081 0.0019526270 0.007510260 1.277419e-02
## 2015-06-30 -0.0108258091 -0.029746812 -0.0316786936 0.004171290 -2.052112e-02
## 2015-07-31 0.0085845667 -0.065177911 0.0201142167 -0.027375501 2.233814e-02
## 2015-08-31 -0.0033635046 -0.092512275 -0.0771522762 -0.047268221 -6.288702e-02
## 2015-09-30 0.0080817044 -0.031825243 -0.0451948145 -0.038464762 -2.584725e-02
## 2015-10-30 0.0006848653 0.061808363 0.0640257723 0.063589797 8.163524e-02
## 2015-11-30 -0.0038986277 -0.025560385 -0.0075556617 0.024414858 3.648616e-03
## 2015-12-31 -0.0019190448 -0.038946936 -0.0235950923 -0.052156883 -1.743375e-02
## 2016-01-29 0.0123303593 -0.051636920 -0.0567579406 -0.060306856 -5.106899e-02
## 2016-02-29 0.0088319698 -0.008211499 -0.0339136892 0.020605259 -8.257876e-04
## 2016-03-31 0.0087087681 0.121878923 0.0637457309 0.089910528 6.510030e-02
## 2016-04-29 0.0025458859 0.004079345 0.0219752051 0.021044302 3.932912e-03
## 2016-05-31 0.0001357041 -0.037628548 -0.0008563037 0.004397156 1.686892e-02
## 2016-06-30 0.0191668646 0.044582476 -0.0244916223 0.008291854 3.469667e-03
## 2016-07-29 0.0054298730 0.052442012 0.0390002054 0.049348591 3.582174e-02
## 2016-08-31 -0.0021568992 0.008798525 0.0053270101 0.011261114 1.196910e-03
## 2016-09-30 0.0005158697 0.024873025 0.0132791830 0.008614564 5.799062e-05
## 2016-10-31 -0.0082052795 -0.008312354 -0.0224037071 -0.038135000 -1.748883e-02
## 2016-11-30 -0.0259892499 -0.045161759 -0.0179745848 0.125246532 3.617574e-02
## 2016-12-30 0.0025383724 -0.002529762 0.0267028073 0.031491924 2.006918e-02
## 2017-01-31 0.0021261899 0.064431261 0.0323820121 -0.012143994 1.773668e-02
## 2017-02-28 0.0064374388 0.017257862 0.0118364660 0.013428701 3.853909e-02
## 2017-03-31 -0.0005527735 0.036188966 0.0318055682 -0.006532919 1.249386e-03
## 2017-04-28 0.0090293927 0.016866422 0.0239522182 0.005107632 9.877036e-03
## 2017-05-31 0.0068475825 0.028059804 0.0348103046 -0.022862461 1.401440e-02
## 2017-06-30 -0.0001832239 0.009223562 0.0029558906 0.029151906 6.354424e-03
## 2017-07-31 0.0033348199 0.056594763 0.0261878297 0.007481283 2.034584e-02
## 2017-08-31 0.0093691216 0.023243854 -0.0004483498 -0.027564505 2.913453e-03
## 2017-09-29 -0.0057326254 -0.000446030 0.0233428154 0.082321661 1.994913e-02
## 2017-10-31 0.0009780530 0.032278265 0.0166538869 0.005915990 2.329061e-02
## 2017-11-30 -0.0014835961 -0.003897034 0.0068699458 0.036913237 3.010822e-02
## 2017-12-29 0.0047399617 0.036925439 0.0133982206 -0.003731176 1.205488e-02
calculate_component_contribution <- function(.data, w) {
# Covariance of asset returns
covariance_matrix <- cov(.data)
# Standard deviation of portfolio
# Summarizes how much each asset's returns vary with those of other assets within the portfolio into a single number
sd_portfolio <- sqrt(t(w) %*% covariance_matrix %*% w)
# Component contribution
# Similar to the formula for sd_portfolio
# Mathematical trick to summarize the same, sd_portfolio, by asset instead of a single number
component_contribution <- (t(w) %*% covariance_matrix * w) / sd_portfolio[1,1]
component_contribution
# Component contribution in percentage
component_percentages <- (component_contribution / sd_portfolio[1,1]) %>%
round(3) %>%
as_tibble()
return(component_percentages)
}
asset_returns_wide_tbl %>% calculate_component_contribution(w = c(0.25, 0.25, 0.2, 0.2, 0.1))
## # A tibble: 1 × 5
## AGG EEM EFA IJS SPY
## <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 0.017 0.394 0.248 0.242 0.099
Column Chart of Component Contribution
plot_data <- asset_returns_wide_tbl %>% calculate_component_contribution(w = c(0.25, 0.25, 0.2, 0.2, 0.1)) %>%
# transform to long form
pivot_longer(cols = everything(), names_to = "Asset", values_to = "Contribution")
plot_data %>%
ggplot(aes(x = Asset, y = Contribution)) +
geom_col(fill = "cornflowerblue") +
scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
theme(plot.title = element_text(hjust = .5)) +
labs(title = "Percent Contribution to Portfolio Volatility")
Column Chart of Component Contribution and weight
plot_data <- asset_returns_wide_tbl %>% calculate_component_contribution(w = c(0.25, 0.25, 0.2, 0.2, 0.1)) %>%
# transform to long form
pivot_longer(cols = everything(), names_to = "Asset", values_to = "Contribution") %>%
# add weights
add_column(weight = c(0.25, 0.25, 0.2, 0.2, 0.1)) %>%
# transform to long
pivot_longer(cols = c(Contribution, weight), names_to = "type", values_to = "value")
plot_data %>%
ggplot(aes(x = Asset, y = value, fill = type)) +
geom_col(position = "dodge") +
scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
scale_fill_tq()
theme(plot.title = element_text(hjust = .5)) +
theme_tq() +
labs(title = "Percent Contribution to Portfolio Volatility and Weight",
y = "Percent",
x = NULL)
## <theme> List of 146
## $ line : <ggplot2::element_line>
## ..@ colour : chr "#2c3e50"
## ..@ linewidth : num 0.5
## ..@ linetype : num 1
## ..@ lineend : chr "butt"
## ..@ linejoin : NULL
## ..@ arrow : logi FALSE
## ..@ arrow.fill : chr "#2c3e50"
## ..@ inherit.blank: logi TRUE
## $ rect : <ggplot2::element_rect>
## ..@ fill : chr "#FFFFFF"
## ..@ colour : chr "#2c3e50"
## ..@ linewidth : num 0.5
## ..@ linetype : num 1
## ..@ linejoin : NULL
## ..@ inherit.blank: logi TRUE
## $ text : <ggplot2::element_text>
## ..@ family : chr ""
## ..@ face : chr "plain"
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : chr "#2c3e50"
## ..@ size : num 11
## ..@ hjust : num 0.5
## ..@ vjust : num 0.5
## ..@ angle : num 0
## ..@ lineheight : num 0.9
## ..@ margin : <ggplot2::margin> num [1:4] 0 0 0 0
## ..@ debug : logi FALSE
## ..@ inherit.blank: logi TRUE
## $ title : chr "Percent Contribution to Portfolio Volatility and Weight"
## $ point : <ggplot2::element_point>
## ..@ colour : chr "black"
## ..@ shape : num 19
## ..@ size : num 1.5
## ..@ fill : chr "white"
## ..@ stroke : num 0.5
## ..@ inherit.blank: logi TRUE
## $ polygon : <ggplot2::element_polygon>
## ..@ fill : chr "white"
## ..@ colour : chr "black"
## ..@ linewidth : num 0.5
## ..@ linetype : num 1
## ..@ linejoin : chr "round"
## ..@ inherit.blank: logi TRUE
## $ geom : <ggplot2::element_geom>
## ..@ ink : chr "black"
## ..@ paper : chr "white"
## ..@ accent : chr "#3366FF"
## ..@ linewidth : num 0.5
## ..@ borderwidth: num 0.5
## ..@ linetype : int 1
## ..@ bordertype : int 1
## ..@ family : chr ""
## ..@ fontsize : num 3.87
## ..@ pointsize : num 1.5
## ..@ pointshape : num 19
## ..@ colour : NULL
## ..@ fill : NULL
## $ spacing : 'simpleUnit' num 5.5points
## ..- attr(*, "unit")= int 8
## $ margins : <ggplot2::margin> num [1:4] 5.5 5.5 5.5 5.5
## $ aspect.ratio : NULL
## $ axis.title : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : 'rel' num 1
## ..@ hjust : NULL
## ..@ vjust : NULL
## ..@ angle : NULL
## ..@ lineheight : NULL
## ..@ margin : NULL
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ axis.title.x : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : NULL
## ..@ hjust : NULL
## ..@ vjust : num 1
## ..@ angle : NULL
## ..@ lineheight : NULL
## ..@ margin : <ggplot2::margin> num [1:4] 2.75 0 0 0
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ axis.title.x.top : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : NULL
## ..@ hjust : NULL
## ..@ vjust : num 0
## ..@ angle : NULL
## ..@ lineheight : NULL
## ..@ margin : <ggplot2::margin> num [1:4] 0 0 2.75 0
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ axis.title.x.bottom : NULL
## $ axis.title.y : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : NULL
## ..@ hjust : NULL
## ..@ vjust : num 1
## ..@ angle : num 90
## ..@ lineheight : NULL
## ..@ margin : <ggplot2::margin> num [1:4] 0 2.75 0 0
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ axis.title.y.left : NULL
## $ axis.title.y.right : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : NULL
## ..@ hjust : NULL
## ..@ vjust : num 1
## ..@ angle : num -90
## ..@ lineheight : NULL
## ..@ margin : <ggplot2::margin> num [1:4] 0 0 0 2.75
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ axis.text : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : 'rel' num 0.8
## ..@ hjust : NULL
## ..@ vjust : NULL
## ..@ angle : NULL
## ..@ lineheight : NULL
## ..@ margin : NULL
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ axis.text.x : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : NULL
## ..@ hjust : NULL
## ..@ vjust : num 1
## ..@ angle : NULL
## ..@ lineheight : NULL
## ..@ margin : <ggplot2::margin> num [1:4] 2.2 0 0 0
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ axis.text.x.top : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : NULL
## ..@ hjust : NULL
## ..@ vjust : num 0
## ..@ angle : NULL
## ..@ lineheight : NULL
## ..@ margin : <ggplot2::margin> num [1:4] 0 0 2.2 0
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ axis.text.x.bottom : NULL
## $ axis.text.y : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : NULL
## ..@ hjust : num 1
## ..@ vjust : NULL
## ..@ angle : NULL
## ..@ lineheight : NULL
## ..@ margin : <ggplot2::margin> num [1:4] 0 2.2 0 0
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ axis.text.y.left : NULL
## $ axis.text.y.right : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : NULL
## ..@ hjust : num 0
## ..@ vjust : NULL
## ..@ angle : NULL
## ..@ lineheight : NULL
## ..@ margin : <ggplot2::margin> num [1:4] 0 0 0 2.2
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ axis.text.theta : NULL
## $ axis.text.r : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : NULL
## ..@ hjust : num 0.5
## ..@ vjust : NULL
## ..@ angle : NULL
## ..@ lineheight : NULL
## ..@ margin : <ggplot2::margin> num [1:4] 0 2.2 0 2.2
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ axis.ticks : <ggplot2::element_line>
## ..@ colour : chr "grey80"
## ..@ linewidth : 'rel' num 0.333
## ..@ linetype : NULL
## ..@ lineend : NULL
## ..@ linejoin : NULL
## ..@ arrow : logi FALSE
## ..@ arrow.fill : chr "grey80"
## ..@ inherit.blank: logi TRUE
## $ axis.ticks.x : NULL
## $ axis.ticks.x.top : NULL
## $ axis.ticks.x.bottom : NULL
## $ axis.ticks.y : NULL
## $ axis.ticks.y.left : NULL
## $ axis.ticks.y.right : NULL
## $ axis.ticks.theta : NULL
## $ axis.ticks.r : NULL
## $ axis.minor.ticks.x.top : NULL
## $ axis.minor.ticks.x.bottom : NULL
## $ axis.minor.ticks.y.left : NULL
## $ axis.minor.ticks.y.right : NULL
## $ axis.minor.ticks.theta : NULL
## $ axis.minor.ticks.r : NULL
## $ axis.ticks.length : 'rel' num 0.5
## $ axis.ticks.length.x : NULL
## $ axis.ticks.length.x.top : NULL
## $ axis.ticks.length.x.bottom : NULL
## $ axis.ticks.length.y : NULL
## $ axis.ticks.length.y.left : NULL
## $ axis.ticks.length.y.right : NULL
## $ axis.ticks.length.theta : NULL
## $ axis.ticks.length.r : NULL
## $ axis.minor.ticks.length : 'rel' num 0.75
## $ axis.minor.ticks.length.x : NULL
## $ axis.minor.ticks.length.x.top : NULL
## $ axis.minor.ticks.length.x.bottom: NULL
## $ axis.minor.ticks.length.y : NULL
## $ axis.minor.ticks.length.y.left : NULL
## $ axis.minor.ticks.length.y.right : NULL
## $ axis.minor.ticks.length.theta : NULL
## $ axis.minor.ticks.length.r : NULL
## $ axis.line : <ggplot2::element_blank>
## $ axis.line.x : NULL
## $ axis.line.x.top : NULL
## $ axis.line.x.bottom : NULL
## $ axis.line.y : NULL
## $ axis.line.y.left : NULL
## $ axis.line.y.right : NULL
## $ axis.line.theta : NULL
## $ axis.line.r : NULL
## $ legend.background : <ggplot2::element_rect>
## ..@ fill : NULL
## ..@ colour : logi NA
## ..@ linewidth : NULL
## ..@ linetype : NULL
## ..@ linejoin : NULL
## ..@ inherit.blank: logi TRUE
## $ legend.margin : NULL
## $ legend.spacing : 'rel' num 2
## $ legend.spacing.x : NULL
## $ legend.spacing.y : NULL
## $ legend.key : <ggplot2::element_rect>
## ..@ fill : chr "#FFFFFF"
## ..@ colour : logi NA
## ..@ linewidth : NULL
## ..@ linetype : NULL
## ..@ linejoin : NULL
## ..@ inherit.blank: logi TRUE
## $ legend.key.size : 'simpleUnit' num 1.2lines
## ..- attr(*, "unit")= int 3
## $ legend.key.height : NULL
## $ legend.key.width : NULL
## $ legend.key.spacing : NULL
## $ legend.key.spacing.x : NULL
## $ legend.key.spacing.y : NULL
## $ legend.key.justification : NULL
## $ legend.frame : NULL
## $ legend.ticks : NULL
## $ legend.ticks.length : 'rel' num 0.2
## $ legend.axis.line : NULL
## $ legend.text : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : 'rel' num 0.8
## ..@ hjust : NULL
## ..@ vjust : NULL
## ..@ angle : NULL
## ..@ lineheight : NULL
## ..@ margin : NULL
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ legend.text.position : NULL
## $ legend.title : <ggplot2::element_text>
## ..@ family : NULL
## ..@ face : NULL
## ..@ italic : chr NA
## ..@ fontweight : num NA
## ..@ fontwidth : num NA
## ..@ colour : NULL
## ..@ size : NULL
## ..@ hjust : num 0
## ..@ vjust : NULL
## ..@ angle : NULL
## ..@ lineheight : NULL
## ..@ margin : NULL
## ..@ debug : NULL
## ..@ inherit.blank: logi TRUE
## $ legend.title.position : NULL
## $ legend.position : chr "bottom"
## $ legend.position.inside : NULL
## $ legend.direction : NULL
## $ legend.byrow : NULL
## $ legend.justification : chr "center"
## $ legend.justification.top : NULL
## $ legend.justification.bottom : NULL
## $ legend.justification.left : NULL
## $ legend.justification.right : NULL
## $ legend.justification.inside : NULL
## [list output truncated]
## @ complete: logi TRUE
## @ validate: logi TRUE