Portfolio Performance Report

# Some global stuff
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(knitr))
#params <- readRDS("params.RDS")

The following Portfolio Report was automatically generated by the lares library:

All time performance

ggplot2:::plot.ggplot(params$plots_fixed$`Positions`)

Dynamic time periods report {.tabset}

ts <- gsub("plots_", "", names(params$plots_relative))
plot_names <- names(params$plots_relative[[1]])
for (p in seq_along(plot_names)){
  cat(paste0("### ", plot_names[p], "{.tabset}\n"))
  for (i in seq_along(ts)){
      cat("####", ts[i], '<br>', '\n')
      ggplot2:::plot.ggplot(params$plots_relative[[i]][[p]])
      cat('\n', '<br>', '\n\n')
  }
  cat('\n', '<br>', '\n\n')
}

Tabulated data {.tabset}

tables <- list(
  "Stocks Summary" = kable(params$summary_df1, align = "lrcrrrr", row.names = TRUE, digits = c(0, 2, 0, 2, 0, 0, 1), format.args = list(big.mark = ",")),
  "Portfolio Summary" = kable(params$summary_df2, align = "lcc", row.names = FALSE))
for (i in seq_along(tables)){
  cat("###", names(tables)[i], '<br>', '\n')
  print(tables[[i]])
  cat('\n', '<br>', '\n\n')
}

Overall portfolio information {.tabset}

other <- names(params$plots_fixed)
# Exclude summary which has already been plotted
for (i in seq_along(other)[-1]){
  p <- params$plots_fixed[[i]]
  if (!is.null(p)) {
    cat("###", other[i], '<br>', '\n')
    ggplot2:::plot.ggplot(p)
    cat('\n', '<br>', '\n\n')
  }
}

Report generated timestamp: r Sys.time()



Try the lares package in your browser

Any scripts or data that you put into this service are public.

lares documentation built on Nov. 5, 2023, 1:09 a.m.