#PROJECT-4: Mutual Fund(Indian) Performance based on Five Key Indicators

knitr::opts_chunk$set(root.dir = "C:/Users/rsman/Documents/PERS FOLDERS/RAJDEEP/INVESTMENTS/ANALYSIS/DATA")
library(lubridate)
library(stringr)
library(pander)
library(data.table)
library(xlsx)
library(dplyr)
library(scales)
library(ggplot2)
library(Quandl)
library(tabulizer)
library(knitr)
library(kableExtra)
library(formattable)
library(DT)
library(rio)
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(root.dir = "C:/Users/rsman/Documents/PERS FOLDERS/RAJDEEP/INVESTMENTS/ANALYSIS/DATA")
getwd()

[1] “C:/Users/rsman/Documents/PERS FOLDERS/RAJDEEP/INVESTMENTS/ANALYSIS/DATA”

###Functions
colFmt1 = function(x,color){
  outputFormat = knitr::opts_knit$get("rmarkdown.pandoc.to")
  if(outputFormat == 'latex')
    paste("\\textcolor{",color,"}{",x,"}",sep="")
  else if(outputFormat == 'html')
    paste("<font color='",color,"'>",x,"</font>",sep="")
  else
    x
}

colFmt = function(x,color){
  outputFormat = knitr::opts_knit$get("rmarkdown.pandoc.to")
  if(outputFormat == 'html')
    paste("<font color='",color,"'>",x,"</font>",sep="")
  else
    x
}

makeCharac <- function(rx.vr){
  new.vr <- as.character(rx.vr)
  return(new.vr)
}

makeNumeric <- function(rx.vr){
  new.vr <- as.numeric(rx.vr)
  return(new.vr)
}


###End Functions

CWD <- "C:/Users/rsman/Documents/PERS FOLDERS/RAJDEEP/INVESTMENTS/ANALYSIS/DATA/"
setwd("C:/Users/rsman/Documents/PERS FOLDERS/RAJDEEP/INVESTMENTS/ANALYSIS/DATA")
CWD <- getwd()
knitr::opts_chunk$set(echo = TRUE)
pandoc.header(colFmt("Section-1: MF Performance using Valuresearchonline Data", 'red'), 1, 'setext')

Section-1: MF Performance using Valuresearchonline Data

data.org <- function(rx.df){
  rx.df <- rx.df[-1:-5,]
  for (ctr in 1: ncol(rx.df)) {
    rx.df[,ctr]<- makeCharac(rx.df[,ctr])
    }
  
  colnames(rx.df) <- rx.df[1,]
  rx.df <- rx.df[-1,]
  return(rx.df)
  
}

vr.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_snapshot.csv"), header = FALSE))
vr_x.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_snapshot_1.csv"), header = FALSE))
vr_y.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_snapshot_2.csv"), header = FALSE))
vr.df <- rbind(vr.df, vr_x.df, vr_y.df)
vr.df <- data.org(vr.df)

vr2.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_returns.csv"), header = FALSE))
vr2.df <- data.org(vr2.df)
vr2_lt.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_returns_lt.csv"), header = FALSE))
vr2_lt.df <- data.org(vr2_lt.df)
vr2.df <- merge(vr2.df, vr2_lt.df, by.x = "Fund Name", by.y = "Fund Name")

vr2_x.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_returns_1.csv"), header = FALSE))
vr2_x.df <- data.org(vr2_x.df)
vr2_x_lt.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_returns_1_lt.csv"), header = FALSE))
vr2_x_lt.df <- data.org(vr2_x_lt.df)
vr2_x.df <- merge(vr2_x.df, vr2_x_lt.df, by.x = "Fund Name", by.y = "Fund Name")


vr2_y.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_returns_2.csv"), header = FALSE))
vr2_y.df <- data.org(vr2_y.df)
vr2_y_lt.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_returns_2_lt.csv"), header = FALSE))
vr2_y_lt.df <- data.org(vr2_y_lt.df)
vr2_y.df <- merge(vr2_y.df, vr2_y_lt.df, by.x = "Fund Name", by.y = "Fund Name")

vr2.df <- rbind(vr2.df, vr2_x.df, vr2_y.df)

vr3.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_risk.csv"), header = FALSE))
vr3_x.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_risk_1.csv"), header = FALSE))
vr3_y.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_risk_2.csv"), header = FALSE))
vr3.df <- rbind(vr3.df, vr3_x.df, vr3_y.df)
vr3.df <- data.org(vr3.df)

vr4.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_portfolio.csv"), header = FALSE))
vr4_x.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_portfolio_1.csv"), header = FALSE))
vr4_y.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_portfolio_2.csv"), header = FALSE))
vr4.df <- rbind(vr4.df, vr4_x.df, vr4_y.df)
vr4.df <- data.org(vr4.df)

vr5.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_nav.csv"), header = FALSE))
vr5_x.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_nav_1.csv"), header = FALSE))
vr5_y.df <- as.data.frame(read.csv(paste0(CWD,"/PERFORMANCE/vr_nav_2.csv"), header = FALSE))
vr5.df <- rbind(vr5.df, vr5_x.df, vr5_y.df)

analysis.df <- as.data.frame(read.xlsx(paste0(CWD,"/PERFORMANCE/ratio_analysis.xlsx"), sheetIndex = 1, header = TRUE))





vr.df <- merge(vr.df, vr2.df, by.x = "Fund Name", by.y = "Fund Name")
vr.df <- merge(vr.df, vr3.df, by.x = "Fund Name", by.y = "Fund Name")
vr.df <- merge(vr.df, vr4.df, by.x = "Fund Name", by.y = "Fund Name")

rm(vr2.df)
rm(vr3.df)
rm(vr4.df)

r_sq.vr <- as.numeric(as.character(analysis.df[analysis.df$type=="r_sq",2]))
beta.vr <- as.numeric(as.character(analysis.df[analysis.df$type=="beta",2]))
alpha.vr <- as.numeric(as.character(analysis.df[analysis.df$type=="alpha",2]))
sharpe_ratio.vr <- as.numeric(as.character(analysis.df[analysis.df$type=="sharpe_ratio",2]))
expense_ratio.vr <- as.numeric(as.character(analysis.df[analysis.df$type=="expense_ratio",2]))*100
max.values <- c(r_sq.vr, beta.vr, alpha.vr, sharpe_ratio.vr, expense_ratio.vr)

r_sq.min <- as.numeric(as.character(analysis.df[analysis.df$type=="r_sq",3]))
beta.min <- as.numeric(as.character(analysis.df[analysis.df$type=="beta",3]))
alpha.min <- as.numeric(as.character(analysis.df[analysis.df$type=="alpha",3]))
sharpe_ratio.min <- as.numeric(as.character(analysis.df[analysis.df$type=="sharpe_ratio",3]))
expense_ratio.min <- as.numeric(as.character(analysis.df[analysis.df$type=="expense_ratio",3]))*100
min.values <- c(r_sq.min, beta.min, alpha.min, sharpe_ratio.min, expense_ratio.min)

########

aa.mf <- vr.df

aa.mf$`R-Squared` <- makeNumeric(aa.mf$`R-Squared`)
aa.mf$Beta <- makeNumeric(aa.mf$Beta)
aa.mf$Alpha <- makeNumeric(aa.mf$Alpha)
aa.mf$`Sharpe Ratio` <- makeNumeric(aa.mf$`Sharpe Ratio`)
aa.mf$`Expense Ratio (%)` <- makeNumeric(aa.mf$`Expense Ratio (%)`)
aa.mf$`1 Yr Ret (%).x` <- makeNumeric(aa.mf$`1 Yr Ret (%).x`)
aa.mf$`3 Yr Ret (%)` <- makeNumeric(aa.mf$`3 Yr Ret (%)`)
aa.mf$`5 Yr Ret (%)` <- makeNumeric(aa.mf$`5 Yr Ret (%)`)
aa.mf$`10 Yr Ret (%)` <- makeNumeric(aa.mf$`10 Yr Ret (%)`)
aa.mf$`Net Assests (Cr).x`<- makeNumeric(aa.mf$`Net Assets (Cr).x`)

#Remove all NA from aa.mf
if (nrow(aa.mf[is.na(aa.mf$`Expense Ratio (%)`),])>0) {
  aa.mf <- aa.mf[-which(is.na(aa.mf$`Expense Ratio (%)`)),]
}

if (nrow(aa.mf[is.na(aa.mf$`R-Squared`),])>0) {
  aa.mf <- aa.mf[-which(is.na(aa.mf$`R-Squared`)),]
}

if (nrow(aa.mf[is.na(aa.mf$`Sharpe Ratio`),])>0) {
  aa.mf <- aa.mf[-which(is.na(aa.mf$`Sharpe Ratio`)),]
}

if (nrow(aa.mf[is.na(aa.mf$Alpha),])>0) {
  aa.mf <- aa.mf[-which(is.na(aa.mf$Alpha)),]
}

if (nrow(aa.mf[is.na(aa.mf$Beta),])>0) {
  aa.mf <- aa.mf[-which(is.na(aa.mf$Beta)),]
}

vr.df.new <- aa.mf
vr.df.new$Launch <- gsub(",","",vr.df.new$Launch)
vr.df.new$Launch <- gsub(" ","/",vr.df.new$Launch)
#vr.df.new$Launch <- as.Date(vr.df.new$Launch, "%m/%d/%Y")
vr.df.new$Launch <- mdy(vr.df.new$Launch)


#aa.mf <- vr.df
aa.mf$rank1 <- as.numeric(substr(aa.mf$`1 Yr Rank.x`,1,unlist(str_locate(aa.mf$`1 Yr Rank.x`,"/"))[,1]-1))
aa.mf <- aa.mf[-which(is.na(aa.mf$rank1)),]
selected.mf <- aa.mf[aa.mf$rank1 <=10,]
selected.mf <- aa.mf

r_sq.avg <- mean(selected.mf$`R-Squared`)
beta.avg <- mean(selected.mf$Beta)
alpha.avg <- mean(selected.mf$Alpha)
sharpe_ratio.avg <- mean(selected.mf$`Sharpe Ratio`)
expense_ratio.avg <- mean(selected.mf$`Expense Ratio (%)`)
avg.values <- c(r_sq.avg, beta.avg, alpha.avg, sharpe_ratio.avg, expense_ratio.avg)
tmp.df <- data.frame(matrix(ncol =1, nrow =0))
tmp.df <- rbind(tmp.df, r_sq.avg, beta.avg, alpha.avg, sharpe_ratio.avg, expense_ratio.avg)
colnames(tmp.df) <- c("avg")
analysis.df <- cbind(analysis.df, tmp.df)

##### old loc


mf.filter <- function(mf.rx, values.rx ){
  
  rsq.rx<- values.rx[1]
  beta.rx <- values.rx[2] 
  alpha.rx <- values.rx[3]
  shrpe.rx <- values.rx[4]
  exp.rx <- values.rx[5]
  
  mf.rx <- mf.rx[mf.rx$`R-Squared`>=rsq.rx,]
  mf.rx <- mf.rx[mf.rx$Beta >= beta.rx,]
  mf.rx <- mf.rx[mf.rx$Alpha>= alpha.rx,]
  mf.rx <- mf.rx[mf.rx$`Sharpe Ratio`>= shrpe.rx,]
  mf.rx <- mf.rx[mf.rx$`Expense Ratio (%)`<= exp.rx,]
  
  return(mf.rx)
  
}

pandoc.header(colFmt("1A: MF's filtered on optimal values of R-Sq, Alpha, Beta, Sharpe Ratio & Exp-Ratio", 'blue'), 1, 'setext')

1A: MF’s filtered on optimal values of R-Sq, Alpha, Beta, Sharpe Ratio & Exp-Ratio

#knitr::kable(analysis.df, caption = colFmt("Filter Values", "blue"))

##$$$$$
paste(colFmt( "Rations/Values used to Compare Mutual Funds (Average Value is based on Present Market Status", "blue"))

[1] “Rations/Values used to Compare Mutual Funds (Average Value is based on Present Market Status

analysis.df[1:5, 1:4] %>%
  mutate(
    Ser.No = row.names(.),
    Factor = (type),
    Max.Value = (value),
    Min.Value = (min),
    Average.Value =(avg)
  ) %>%
  select(Ser.No,Factor, Max.Value, Min.Value, Average.Value) %>%
  kable(escape = F) %>%
  kable_styling("hover", full_width = F) %>%
  column_spec(5, width = "3cm")
Ser.No Factor Max.Value Min.Value Average.Value
1 r_sq 0.750 0.600 0.6751398
2 beta 1.100 1.000 0.7643808
3 alpha 2.000 1.400 -0.4640346
4 sharpe_ratio 1.500 0.750 0.4383688
5 expense_ratio 0.015 0.025 1.2104860
##$$$$$


##Filter with max values
top.mf<- mf.filter(aa.mf, max.values)
rownames(top.mf) <- NULL
row.ctr <- nrow(top.mf)
paste(colFmt( "Mutual Funds Meeting the Maximum Criteria", "blue"))

[1] “Mutual Funds Meeting the Maximum Criteria

top.mf[1:row.ctr,c(1,37,35,36,33,6,7,22)] %>%
  mutate(
    Ser.No = row.names(.),
    Fund = (`Fund Name`),
    R_Sq = (`R-Squared`),
    Beta = (Beta),
    Alpha = (Alpha),
    Sharpe_Ratio = (`Sharpe Ratio`),
    Exp_Ratio = (`Expense Ratio (%)`),
    Return_1Yr =(`1 Yr Ret (%).x`),
    Return_5Yr =(`5 Yr Ret (%)`),
    
  ) %>%
  select(Ser.No,Fund, R_Sq, Beta, Alpha, Sharpe_Ratio, Exp_Ratio, Return_1Yr, Return_5Yr) %>%
  kable(escape = F) %>%
  kable_styling("hover", full_width = F)
Ser.No Fund R_Sq Beta Alpha Sharpe_Ratio Exp_Ratio Return_1Yr Return_5Yr
NA NA NA NA NA NA NA NA NA
##filter with min values
top.mf<- mf.filter(aa.mf, min.values)
rownames(top.mf) <- NULL
row.ctr <- nrow(top.mf)
paste(colFmt( "Mutual Funds Meeting the Minimum Criteria", "blue"))

[1] “Mutual Funds Meeting the Minimum Criteria

top.mf[1:row.ctr,c(1,37,35,36,33,6,7,22)] %>%
  mutate(
    Ser.No = row.names(.),
    Fund = (`Fund Name`),
    R_Sq = (`R-Squared`),
    Beta = (Beta),
    Alpha = (Alpha),
    Sharpe_Ratio = (`Sharpe Ratio`),
    Exp_Ratio = (`Expense Ratio (%)`),
    Return_1Yr =(`1 Yr Ret (%).x`),
    Return_5Yr =(`5 Yr Ret (%)`),
    
  ) %>%
  select(Ser.No,Fund, R_Sq, Beta, Alpha, Sharpe_Ratio, Exp_Ratio, Return_1Yr, Return_5Yr) %>%
  kable(escape = F) %>%
  kable_styling("hover", full_width = T)
Ser.No Fund R_Sq Beta Alpha Sharpe_Ratio Exp_Ratio Return_1Yr Return_5Yr
1 Axis Dynamic Bond Fund 0.67 1.34 1.71 1.20 0.67 13.29 8.98
2 Axis Dynamic Bond Fund - Direct Plan 0.68 1.33 2.42 1.42 0.25 13.78 9.85
3 ICICI Prudential All Seasons Bond Fund 0.68 1.08 1.58 1.28 1.52 12.66 9.59
4 ICICI Prudential All Seasons Bond Fund - Direct Plan 0.68 1.08 2.28 1.54 0.80 13.42 10.36
5 ICICI Prudential Bond Fund - Direct Plan 0.61 1.13 1.83 1.27 0.56 12.46 9.14
6 IDFC Dynamic Bond Fund - Direct Plan 0.84 1.77 1.61 1.17 0.86 13.89 9.95
7 Kotak Dynamic Bond Fund - Direct Plan 0.67 1.14 2.77 1.64 0.45 12.30 10.31
8 Kotak Dynamic Bond Fund - Regular Plan 0.67 1.14 2.15 1.43 1.15 11.56 9.63
9 L&T Flexi Bond Fund - Direct Plan 0.84 1.38 1.41 1.23 0.96 10.97 9.35
10 L&T Triple Ace Bond Fund 0.71 1.63 1.57 1.11 0.63 13.25 8.59
11 L&T Triple Ace Bond Fund - Direct Plan 0.71 1.63 1.87 1.18 0.29 13.62 9.19
12 Mirae Asset Dynamic Bond Fund - Direct Plan 0.67 1.22 2.11 1.38 0.49 11.40 NA
13 SBI Dynamic Bond Fund - Direct Plan 0.80 1.51 1.61 1.22 0.87 12.01 9.97
14 SBI Magnum Income Fund 0.62 1.12 1.57 1.20 1.47 13.57 9.18
15 SBI Magnum Income Fund - Direct Plan 0.62 1.12 2.31 1.45 0.85 14.26 9.95
##filter wiht average values
top.mf<- mf.filter(aa.mf, avg.values)
rownames(top.mf) <- NULL
paste(colFmt( "Mutual Funds Meeting the Average Criteria", "blue"))

[1] “Mutual Funds Meeting the Average Criteria

row.ctr <- nrow(top.mf)
top.mf[1:row.ctr,c(1,37,35,36,33,6,7,22)] %>%
  mutate(
    Ser.No = row.names(.),
    Fund = (`Fund Name`),
    R_Sq = (`R-Squared`),
    Beta = (Beta),
    Alpha = (Alpha),
    Sharpe_Ratio = (`Sharpe Ratio`),
    Exp_Ratio = (`Expense Ratio (%)`),
    Return_1Yr =(`1 Yr Ret (%).x`),
    Return_5Yr =(`5 Yr Ret (%)`),
    
  ) %>%
  select(Ser.No,Fund, R_Sq, Beta, Alpha, Sharpe_Ratio, Exp_Ratio, Return_1Yr, Return_5Yr) %>%
  kable(escape = F) %>%
  kable_styling("hover", full_width = T)
Ser.No Fund R_Sq Beta Alpha Sharpe_Ratio Exp_Ratio Return_1Yr Return_5Yr
1 Aditya Birla Sun Life Government Securities Fund 0.84 0.77 0.25 0.90 1.18 11.72 9.73
2 Aditya Birla Sun Life Government Securities Fund - Direct Plan 0.84 0.77 0.84 1.03 0.58 12.40 10.33
3 Aditya Birla Sun Life Income Fund 0.78 1.64 0.30 0.83 0.89 12.34 8.39
4 Aditya Birla Sun Life Income Fund - Direct Plan 0.79 1.64 1.00 1.01 0.42 12.94 9.21
5 Axis Dynamic Bond Fund - Direct Plan 0.68 1.33 2.42 1.42 0.25 13.78 9.85
6 BNP Paribas Flexi Debt Fund - Direct Plan 0.80 1.23 0.33 0.88 0.51 10.39 8.53
7 Canara Robeco Dynamic Bond Fund - Direct Plan 0.83 1.43 -0.02 0.77 0.88 10.24 8.59
8 Canara Robeco Income Fund - Direct Plan 0.80 1.37 1.34 1.18 0.75 11.24 9.02
9 DSP Government Securities Fund 0.87 0.79 1.04 1.10 1.07 13.21 9.65
10 DSP Government Securities Fund - Direct Plan 0.88 0.79 1.73 1.27 0.54 13.86 10.31
11 HSBC Flexi Debt Fund - Direct Plan 0.85 1.54 0.06 0.80 0.95 9.43 7.92
12 ICICI Prudential All Seasons Bond Fund - Direct Plan 0.68 1.08 2.28 1.54 0.80 13.42 10.36
13 ICICI Prudential Constant Maturity Gilt Fund 0.87 0.82 2.03 1.31 0.39 13.91 10.60
14 ICICI Prudential Constant Maturity Gilt Fund - Direct Plan 0.87 0.82 2.23 1.36 0.23 14.09 10.84
15 IDFC Bond Fund Medium Term Plan - Direct Plan 0.69 0.95 1.97 1.54 0.76 10.97 8.86
16 IDFC Dynamic Bond Fund - Direct Plan 0.84 1.77 1.61 1.17 0.86 13.89 9.95
17 IDFC Government Securities Fund - Constant Maturity Plan - Direct Plan 0.88 0.80 3.46 1.67 0.48 13.96 11.20
18 IDFC Government Securities Fund - Constant Maturity Plan - Regular Plan 0.88 0.80 3.36 1.65 0.61 13.81 11.06
19 IDFC Government Securities Fund - Investment Plan - Direct Plan 0.90 0.84 1.89 1.30 0.61 14.89 10.55
20 Kotak Asset Allocator Fund - Direct Plan 0.69 1.58 3.05 0.44 0.34 19.23 11.73
21 Kotak Bond Fund - Direct Plan 0.81 1.57 0.97 1.03 0.80 12.66 8.88
22 Kotak Gilt Investment - Direct Plan 0.86 0.82 0.83 1.04 0.45 13.38 9.94
23 Kotak Gilt Investment Provident Fund and Trust Plan - Direct Plan 0.86 0.82 0.83 1.04 0.40 13.38 9.94
24 L&T Flexi Bond Fund - Direct Plan 0.84 1.38 1.41 1.23 0.96 10.97 9.35
25 L&T Triple Ace Bond Fund 0.71 1.63 1.57 1.11 0.63 13.25 8.59
26 L&T Triple Ace Bond Fund - Direct Plan 0.71 1.63 1.87 1.18 0.29 13.62 9.19
27 LIC MF Bond Fund - Direct Plan 0.87 1.45 0.16 0.85 0.18 9.94 7.96
28 Nippon India Dynamic Bond Fund - Direct Plan 0.74 1.64 0.10 0.76 0.25 11.18 8.65
29 Nippon India ETF Long Term Gilt 0.92 0.86 -0.17 0.84 0.10 11.00 NA
30 Nippon India Gilt Securities Fund - Direct Plan 0.93 0.77 1.77 1.32 0.62 12.47 11.11
31 Nippon India Income Fund - Direct Plan 0.86 1.75 1.07 1.06 0.72 11.62 9.44
32 Nippon India Pharma Fund - Direct Plan 0.95 0.85 7.88 0.72 1.16 58.29 10.56
33 Parag Parikh Long Term Equity Fund - Direct Plan 0.85 0.79 7.92 0.44 1.01 27.25 15.13
34 PGIM India Dynamic Bond Fund - Direct Plan 0.84 1.36 1.30 1.20 0.87 10.21 9.70
35 Quantum Dynamic Bond Fund - Direct Plan 0.71 1.08 0.65 0.96 0.63 10.64 8.94
36 Quantum Dynamic Bond Fund - Regular Plan 0.71 1.08 0.54 0.92 0.75 10.49 8.83
37 SBI Dynamic Bond Fund - Direct Plan 0.80 1.51 1.61 1.22 0.87 12.01 9.97
38 SBI Tax Advantage Fund - Series III - Direct Plan 0.82 0.93 10.62 0.49 0.88 29.97 18.04
39 Tata Income Fund - Direct Plan 0.69 1.23 0.99 1.02 1.09 13.16 8.72
40 Tata India Pharma & HealthCare Fund - Direct Plan 0.94 0.81 6.49 0.67 1.20 55.36 NA
aa.mf$plus_ctr <- 0 
aa.mf$plus_factors <- ""


filter_ctr <- function(a1.mf, values.rx ){
  
  a1.mf$plus_ctr <- 0 
  a1.mf$plus_factors <- ""
  
  rsq.vx<- values.rx[1]
  beta.vx <- values.rx[2] 
  alpha.vx <- values.rx[3]
  sharpe_ratio.vx <- values.rx[4]
  expense_ratio.vx <- values.rx[5]
  
  a1.mf[a1.mf$`R-Squared` >= rsq.vx,]$plus_ctr <- 1
  a1.mf[a1.mf$`R-Squared` >= rsq.vx,]$plus_factors <- "R_Sq"
  
  a1.mf[a1.mf$Beta >= beta.vx,]$plus_ctr <- a1.mf[a1.mf$Beta >= beta.vx,]$plus_ctr +1
  a1.mf[a1.mf$Beta >= beta.vx,]$plus_factors <- paste0(a1.mf[a1.mf$Beta >= beta.vx,]$plus_factors,"-Beta")
  
  a1.mf[a1.mf$Alpha >= alpha.vx,]$plus_ctr <- a1.mf[a1.mf$Alpha >= alpha.vx,]$plus_ctr +1
  a1.mf[a1.mf$Alpha >= alpha.vx,]$plus_factors <- paste0(a1.mf[a1.mf$Alpha >= alpha.vx,]$plus_factors,"-Alpha")
  
  a1.mf[a1.mf$`Sharpe Ratio` >= sharpe_ratio.vx,]$plus_ctr <- a1.mf[a1.mf$`Sharpe Ratio` >= sharpe_ratio.vx,]$plus_ctr +1
  a1.mf[a1.mf$`Sharpe Ratio` >= sharpe_ratio.vx,]$plus_factors <- 
    paste0(a1.mf[a1.mf$`Sharpe Ratio` >= sharpe_ratio.vx,]$plus_ctr,"-Sharpe_Ratio")
  
  a1.mf[a1.mf$`Expense Ratio (%)` <= expense_ratio.vx,]$plus_ctr <- a1.mf[a1.mf$`Expense Ratio (%)` <= expense_ratio.vx,]$plus_ctr +1
  a1.mf[a1.mf$`Expense Ratio (%)` <= expense_ratio.vx,]$plus_factors <- 
    paste0(a1.mf[a1.mf$`Expense Ratio (%)` <= expense_ratio.vx,]$plus_factors, "-Exp_Ratio")
  
  a1.mf <- a1.mf[order(a1.mf$`5 Yr Ret (%)`, decreasing = TRUE),]
  
  return(a1.mf)

  
}

pandoc.header(colFmt("1B: MF's filtered on Four out of Five Criteria", 'blue'), 1, 'setext')

1B: MF’s filtered on Four out of Five Criteria

top.mf <- filter_ctr(aa.mf, max.values)
top.mf <- top.mf[top.mf$plus_ctr >= 4,]
rownames(top.mf) <- NULL
value.string <- paste0("R-Sq:",analysis.df$value[1],", Beta:-",
                       analysis.df$value[2],", Alpha:-",
                       analysis.df$value[3],", Sharpe Ratio:-",
                       analysis.df$value[4],", Expense Ratio:-",
                       analysis.df$value[5])

value.string <- paste("MF's Meeting Max Values of Four our of Five Criteria ",  value.string)
row.ctr <- nrow(top.mf)
paste(colFmt(value.string, "blue"))

[1] “MF’s Meeting Max Values of Four our of Five Criteria R-Sq:0.75, Beta:-1.1, Alpha:-2, Sharpe Ratio:-1.5, Expense Ratio:-0.015

top.mf[1:row.ctr,c(1,37,35,36,33,6,7,22)] %>%
  mutate(
    Ser.No = row.names(.),
    Fund = ('Fund Name'),
    R_Sq = color_tile("white", "orange")(`R-Squared`),
    Beta = color_tile("white", "green")(Beta),
    Alpha = color_tile("white", "blue")(Alpha),
    Sharpe_Ratio = color_tile("white", "purple")(`Sharpe Ratio`),
    Exp_Ratio = (`Expense Ratio (%)`),
    Return_1Yr =color_tile("white", "red")(`1 Yr Ret (%).x`),
    Return_5Yr =color_tile("white", "red")(`5 Yr Ret (%)`),
    
  ) %>%
  select(Ser.No,Fund, R_Sq, Beta, Alpha, Sharpe_Ratio, Exp_Ratio, Return_1Yr, Return_5Yr) %>%
  kable(escape = F) %>%
  kable_styling("hover", full_width = T) %>%
  scroll_box(width = "100%", height = "300px")
Ser.No Fund R_Sq Beta Alpha Sharpe_Ratio Exp_Ratio Return_1Yr Return_5Yr
1 Fund Name 0.88 0.80 3.46 1.67 0.48 13.96 11.20
2 Fund Name 0.88 0.80 3.36 1.65 0.61 13.81 11.06
3 Fund Name 0.76 0.63 2.88 1.59 0.33 12.09 10.86
4 Fund Name 0.76 0.63 2.55 1.50 0.64 11.75 10.49
5 Fund Name 0.67 1.14 2.77 1.64 0.45 12.30 10.31
6 Fund Name 0.06 2.57 7.95 1.58 0.20 14.08 9.38
7 Fund Name 0.05 1.52 5.43 1.75 0.35 11.15 9.32
8 Fund Name 0.04 1.46 5.57 1.68 0.34 10.94 9.18
9 Fund Name 0.11 2.36 6.58 1.77 0.31 11.27 9.11
10 Fund Name 0.06 1.42 5.37 2.12 0.34 10.85 9.06
11 Fund Name 0.04 1.11 5.05 2.20 0.30 11.01 9.05
12 Fund Name 0.04 1.26 5.54 2.04 0.34 10.91 9.01
13 Fund Name 0.13 2.58 6.63 1.69 0.19 9.62 8.99
14 Fund Name 0.05 1.53 5.13 1.61 0.68 10.78 8.98
15 Fund Name 0.13 2.23 6.52 2.07 0.31 9.86 8.94
16 Fund Name 0.14 2.52 6.30 1.62 0.32 10.88 8.92
17 Fund Name 0.05 1.49 5.05 1.66 0.21 10.75 8.87
18 Fund Name 0.13 2.78 7.39 1.79 0.30 11.21 8.86
19 Fund Name 0.17 2.52 6.81 2.05 0.30 6.49 8.84
20 Fund Name 0.11 2.20 6.09 1.72 0.17 10.90 8.83
21 Fund Name 0.08 1.92 5.74 1.66 0.32 10.58 8.81
22 Fund Name 0.04 1.48 5.24 1.53 0.76 10.55 8.80
23 Fund Name 0.11 2.37 6.20 1.60 0.80 10.73 8.77
24 Fund Name 0.12 2.01 5.55 1.77 0.34 10.30 8.74
25 Fund Name 0.13 2.24 6.24 1.93 0.62 9.53 8.68
26 Fund Name 0.09 1.71 5.41 1.90 0.28 10.26 8.67
27 Fund Name 0.09 1.55 5.44 2.26 0.28 9.23 8.64
28 Fund Name 0.06 1.44 4.74 1.71 0.34 10.19 8.64
29 Fund Name 0.13 2.79 7.11 1.68 0.65 10.82 8.61
30 Fund Name 0.10 1.89 5.21 1.65 0.30 9.99 8.60
31 Fund Name 0.13 2.50 5.98 1.50 0.54 10.58 8.59
32 Fund Name 0.17 2.67 6.75 1.86 0.75 5.98 8.59
33 Fund Name 0.06 1.23 4.25 1.81 0.42 9.74 8.57
34 Fund Name 0.13 2.57 6.26 1.54 0.50 9.27 8.57
35 Fund Name 0.17 2.22 5.83 2.01 0.25 10.10 8.52
36 Fund Name 0.07 1.76 5.23 1.61 0.40 10.19 8.43
37 Fund Name 0.04 1.26 5.05 1.80 0.81 10.39 8.43
38 Fund Name 0.11 2.20 5.69 1.54 0.55 10.47 8.38
39 Fund Name 0.04 1.13 4.40 1.81 1.01 10.25 8.30
40 Fund Name 0.06 1.41 4.53 1.66 1.14 9.95 8.12
41 Fund Name 0.09 1.72 4.91 1.63 0.80 9.69 8.11
42 Fund Name 0.10 1.17 3.98 2.32 0.21 8.36 7.99
43 Fund Name 0.17 2.21 5.33 1.72 0.75 9.56 7.98
44 Fund Name 0.09 1.55 4.87 1.92 0.83 8.65 7.97
45 Fund Name 0.17 1.13 3.72 2.83 0.28 7.40 7.92
46 Fund Name 0.37 1.17 3.36 3.39 0.24 6.05 7.88
47 Fund Name 0.40 1.37 3.86 3.39 0.13 6.49 7.77
48 Fund Name 0.42 1.11 3.08 3.43 0.33 5.52 7.76
49 Fund Name 0.17 1.13 3.50 2.59 0.51 7.16 7.72
50 Fund Name 0.54 1.41 3.52 3.22 0.11 6.00 7.72
51 Fund Name 0.22 1.14 3.42 2.83 0.30 6.87 7.62
52 Fund Name 0.45 1.35 3.51 3.15 0.23 6.12 7.59
53 Fund Name 0.22 1.18 3.58 2.87 1.10 6.96 7.56
54 Fund Name 0.42 1.10 2.86 3.06 0.58 5.27 7.54
55 Fund Name 0.40 1.37 3.68 3.13 0.28 6.33 7.53
56 Fund Name 0.23 1.14 3.20 2.55 0.55 6.61 7.40
57 Fund Name 0.37 1.18 2.84 2.51 0.89 5.40 7.39
58 Fund Name 0.44 1.34 3.18 2.68 0.39 5.82 7.24
59 Fund Name 0.10 1.16 3.21 1.68 1.00 7.47 7.23
60 Fund Name 0.55 1.44 3.12 2.48 0.66 5.46 7.22
61 Fund Name 0.30 1.14 2.80 2.31 0.20 6.13 7.19
62 Fund Name 0.29 1.38 3.60 2.52 0.23 6.19 6.99
63 Fund Name 0.22 1.31 2.82 1.57 0.29 5.77 6.97
64 Fund Name 0.28 1.38 3.35 2.25 0.46 5.97 6.73
top.mf <- filter_ctr(aa.mf, min.values)
top.mf <- top.mf[top.mf$plus_ctr >= 4,]
rownames(top.mf) <- NULL
value.string <- paste0("R-Sq:",analysis.df$min[1],", Beta:-",
                       analysis.df$min[2],", Alpha:-",
                       analysis.df$min[3],", Sharpe Ratio:-",
                       analysis.df$min[4],", Expense Ratio:-",
                       analysis.df$min[5])
value.string <- paste("MF's Meeting Min Values of Four our of Five Criteria ",  value.string)
row.ctr <- nrow(top.mf)
paste(colFmt(value.string, "blue"))

[1] “MF’s Meeting Min Values of Four our of Five Criteria R-Sq:0.6, Beta:-1, Alpha:-1.4, Sharpe Ratio:-0.75, Expense Ratio:-0.025

top.mf[1:row.ctr,c(1,37,35,36,33,6,7,22)] %>%
  mutate(
    Ser.No = row.names(.),
    Fund = ('Fund Name'),
    R_Sq = color_tile("white", "orange")(`R-Squared`),
    Beta = color_tile("white", "green")(Beta),
    Alpha = color_tile("white", "blue")(Alpha),
    Sharpe_Ratio = color_tile("white", "purple")(`Sharpe Ratio`),
    Exp_Ratio = (`Expense Ratio (%)`),
    Return_1Yr =color_tile("white", "red")(`1 Yr Ret (%).x`),
    Return_5Yr =color_tile("white", "red")(`5 Yr Ret (%)`),
    
  ) %>%
  select(Ser.No,Fund, R_Sq, Beta, Alpha, Sharpe_Ratio, Exp_Ratio, Return_1Yr, Return_5Yr) %>%
  kable(escape = F) %>%
  kable_styling("hover", full_width = T) %>%
  scroll_box(width = "100%", height = "300px")
Ser.No Fund R_Sq Beta Alpha Sharpe_Ratio Exp_Ratio Return_1Yr Return_5Yr
1 Fund Name 0.83 1.01 6.96 0.31 1.46 27.17 17.78
2 Fund Name 0.95 1.02 3.18 0.19 0.79 16.77 17.25
3 Fund Name 0.88 1.00 5.95 0.27 0.57 25.68 16.71
4 Fund Name 0.95 1.02 2.27 0.15 1.74 15.62 16.24
5 Fund Name 0.89 1.00 4.83 0.23 2.48 23.44 15.89
6 Fund Name 0.89 1.04 6.89 0.30 0.90 18.68 15.85
7 Fund Name 0.89 1.04 5.42 0.24 2.22 17.04 14.37
8 Fund Name 0.95 1.01 4.86 0.23 0.52 25.97 12.94
9 Fund Name 0.99 1.00 2.94 0.21 0.07 9.48 12.50
10 Fund Name 0.99 1.00 2.90 0.20 0.07 9.39 12.44
11 Fund Name 0.99 1.00 2.92 0.21 0.07 9.46 12.44
12 Fund Name 0.99 1.00 2.71 0.20 0.28 9.21 12.22
13 Fund Name 0.99 1.00 2.61 0.19 0.10 8.92 12.20
14 Fund Name 0.99 1.00 2.42 0.18 0.30 8.64 12.00
15 Fund Name 0.69 1.58 3.05 0.44 0.34 19.23 11.73
16 Fund Name 0.88 0.80 3.46 1.67 0.48 13.96 11.20
17 Fund Name 0.93 0.77 1.77 1.32 0.62 12.47 11.11
18 Fund Name 0.88 0.80 3.36 1.65 0.61 13.81 11.06
19 Fund Name 0.69 1.58 2.32 0.38 1.05 18.69 10.96
20 Fund Name 0.76 0.63 2.88 1.59 0.33 12.09 10.86
21 Fund Name 0.87 0.82 2.23 1.36 0.23 14.09 10.84
22 Fund Name 0.87 0.82 2.03 1.31 0.39 13.91 10.60
23 Fund Name 0.90 0.84 1.89 1.30 0.61 14.89 10.55
24 Fund Name 0.76 0.63 2.55 1.50 0.64 11.75 10.49
25 Fund Name 0.68 1.08 2.28 1.54 0.80 13.42 10.36
26 Fund Name 0.88 0.79 1.73 1.27 0.54 13.86 10.31
27 Fund Name 0.13 5.39 10.47 0.99 1.39 12.80 10.31
28 Fund Name 0.67 1.14 2.77 1.64 0.45 12.30 10.31
29 Fund Name 0.80 1.51 1.61 1.22 0.87 12.01 9.97
30 Fund Name 0.84 1.77 1.61 1.17 0.86 13.89 9.95
31 Fund Name 0.62 1.12 2.31 1.45 0.85 14.26 9.95
32 Fund Name 0.68 1.33 2.42 1.42 0.25 13.78 9.85
33 Fund Name 0.84 1.36 1.30 1.20 0.87 10.21 9.70
34 Fund Name 0.67 1.14 2.15 1.43 1.15 11.56 9.63
35 Fund Name 0.69 0.59 2.34 1.41 0.89 13.32 9.60
36 Fund Name 0.68 1.08 1.58 1.28 1.52 12.66 9.59
37 Fund Name 0.14 5.41 9.93 0.86 1.99 12.24 9.53
38 Fund Name 0.84 0.67 1.57 1.27 0.76 11.64 9.49
39 Fund Name 0.86 1.75 1.07 1.06 0.72 11.62 9.44
40 Fund Name 0.06 2.57 7.95 1.58 0.20 14.08 9.38
41 Fund Name 0.85 1.78 0.86 1.00 1.35 12.22 9.36
42 Fund Name 0.84 1.38 1.41 1.23 0.96 10.97 9.35
43 Fund Name 0.05 1.52 5.43 1.75 0.35 11.15 9.32
44 Fund Name 0.79 1.64 1.00 1.01 0.42 12.94 9.21
45 Fund Name 0.71 1.63 1.87 1.18 0.29 13.62 9.19
46 Fund Name 0.79 1.52 0.87 1.00 1.64 11.27 9.19
47 Fund Name 0.04 1.46 5.57 1.68 0.34 10.94 9.18
48 Fund Name 0.62 1.12 1.57 1.20 1.47 13.57 9.18
49 Fund Name 0.61 1.13 1.83 1.27 0.56 12.46 9.14
50 Fund Name 0.02 1.11 4.69 1.39 0.36 11.01 9.12
51 Fund Name 0.11 2.36 6.58 1.77 0.31 11.27 9.11
52 Fund Name 0.69 0.59 1.87 1.28 1.36 12.82 9.08
53 Fund Name 0.84 1.77 0.86 0.99 1.70 13.00 9.08
54 Fund Name 0.06 2.59 7.69 1.49 0.55 13.68 9.07
55 Fund Name 0.51 1.36 1.77 1.06 0.49 13.39 9.06
56 Fund Name 0.06 1.42 5.37 2.12 0.34 10.85 9.06
57 Fund Name 0.04 1.11 5.05 2.20 0.30 11.01 9.05
58 Fund Name 0.80 1.37 1.34 1.18 0.75 11.24 9.02
59 Fund Name 0.04 1.26 5.54 2.04 0.34 10.91 9.01
60 Fund Name 0.13 2.58 6.63 1.69 0.19 9.62 8.99
61 Fund Name 0.05 1.53 5.13 1.61 0.68 10.78 8.98
62 Fund Name 0.67 1.34 1.71 1.20 0.67 13.29 8.98
63 Fund Name 0.13 2.23 6.52 2.07 0.31 9.86 8.94
64 Fund Name 0.02 1.03 4.18 1.40 0.37 10.27 8.94
65 Fund Name 0.71 1.08 0.65 0.96 0.63 10.64 8.94
66 Fund Name 0.14 2.52 6.30 1.62 0.32 10.88 8.92
67 Fund Name 0.81 1.57 0.97 1.03 0.80 12.66 8.88
68 Fund Name 0.05 1.49 5.05 1.66 0.21 10.75 8.87
69 Fund Name 0.13 2.78 7.39 1.79 0.30 11.21 8.86
70 Fund Name 0.69 0.95 1.97 1.54 0.76 10.97 8.86
71 Fund Name 0.17 2.52 6.81 2.05 0.30 6.49 8.84
72 Fund Name 0.11 2.20 6.09 1.72 0.17 10.90 8.83
73 Fund Name 0.71 1.08 0.54 0.92 0.75 10.49 8.83
74 Fund Name 0.08 1.92 5.74 1.66 0.32 10.58 8.81
75 Fund Name 0.04 1.48 5.24 1.53 0.76 10.55 8.80
76 Fund Name 0.11 2.37 6.20 1.60 0.80 10.73 8.77
77 Fund Name 0.12 2.01 5.55 1.77 0.34 10.30 8.74
78 Fund Name 0.69 1.23 0.99 1.02 1.09 13.16 8.72
79 Fund Name 0.13 2.24 6.24 1.93 0.62 9.53 8.68
80 Fund Name 0.02 1.11 4.24 1.21 0.81 10.51 8.68
81 Fund Name 0.09 1.71 5.41 1.90 0.28 10.26 8.67
82 Fund Name 0.74 1.64 0.10 0.76 0.25 11.18 8.65
83 Fund Name 0.09 1.55 5.44 2.26 0.28 9.23 8.64
84 Fund Name 0.06 1.44 4.74 1.71 0.34 10.19 8.64
85 Fund Name 0.13 2.79 7.11 1.68 0.65 10.82 8.61
86 Fund Name 0.10 1.89 5.21 1.65 0.30 9.99 8.60
87 Fund Name 0.83 1.43 -0.02 0.77 0.88 10.24 8.59
88 Fund Name 0.13 2.50 5.98 1.50 0.54 10.58 8.59
89 Fund Name 0.71 1.63 1.57 1.11 0.63 13.25 8.59
90 Fund Name 0.83 1.36 0.42 0.91 1.76 9.20 8.59
91 Fund Name 0.17 2.67 6.75 1.86 0.75 5.98 8.59
92 Fund Name 0.06 1.23 4.25 1.81 0.42 9.74 8.57
93 Fund Name 0.13 2.57 6.26 1.54 0.50 9.27 8.57
94 Fund Name 0.85 1.78 0.21 0.84 1.97 11.53 8.57
95 Fund Name 0.61 1.13 1.27 1.08 1.13 11.87 8.56
96 Fund Name 0.02 1.04 3.76 1.21 0.83 9.78 8.55
97 Fund Name 0.86 1.76 0.29 0.86 1.76 10.72 8.55
98 Fund Name 0.62 0.77 1.84 1.57 0.35 10.38 8.54
99 Fund Name 0.80 1.23 0.33 0.88 0.51 10.39 8.53
100 Fund Name 0.48 1.05 1.82 1.17 0.40 9.25 8.53
101 Fund Name 0.17 2.22 5.83 2.01 0.25 10.10 8.52
102 Fund Name 0.84 1.38 0.64 0.98 1.62 10.24 8.48
103 Fund Name 0.07 1.76 5.23 1.61 0.40 10.19 8.43
104 Fund Name 0.04 1.26 5.05 1.80 0.81 10.39 8.43
105 Fund Name 0.78 1.64 0.30 0.83 0.89 12.34 8.39
106 Fund Name 0.11 2.20 5.69 1.54 0.55 10.47 8.38
107 Fund Name 0.05 1.49 4.63 1.46 0.61 10.31 8.37
108 Fund Name 0.63 1.02 0.63 0.91 0.16 10.54 8.33
109 Fund Name 0.04 1.13 4.40 1.81 1.01 10.25 8.30
110 Fund Name 0.08 1.92 5.23 1.43 0.78 10.06 8.27
111 Fund Name 0.02 1.00 4.95 1.63 0.23 10.13 8.16
112 Fund Name 0.63 1.21 1.17 1.04 0.23 7.54 8.15
113 Fund Name 0.11 2.01 5.00 1.48 0.84 9.75 8.15
114 Fund Name 0.06 1.41 4.53 1.66 1.14 9.95 8.12
115 Fund Name 0.09 1.72 4.91 1.63 0.80 9.69 8.11
116 Fund Name 0.80 1.36 0.35 0.87 1.88 10.05 8.03
117 Fund Name 0.11 1.05 3.90 2.75 0.32 7.71 8.03
118 Fund Name 0.10 1.17 3.98 2.32 0.21 8.36 7.99
119 Fund Name 0.17 2.21 5.33 1.72 0.75 9.56 7.98
120 Fund Name 0.09 1.55 4.87 1.92 0.83 8.65 7.97
121 Fund Name 0.87 1.45 0.16 0.85 0.18 9.94 7.96
122 Fund Name 0.14 1.71 3.86 1.37 0.13 8.16 7.95
123 Fund Name 0.85 1.54 0.06 0.80 0.95 9.43 7.92
124 Fund Name 0.17 1.13 3.72 2.83 0.28 7.40 7.92
125 Fund Name 0.06 1.46 4.03 1.33 1.24 9.30 7.91
126 Fund Name 0.37 1.17 3.36 3.39 0.24 6.05 7.88
127 Fund Name 0.90 1.66 0.08 0.83 1.23 9.84 7.87
128 Fund Name 0.81 1.57 -0.01 0.76 1.54 11.46 7.86
129 Fund Name 0.19 1.08 3.82 3.27 0.40 7.62 7.83
130 Fund Name 0.85 1.46 0.29 0.87 1.28 11.15 7.79
131 Fund Name 0.06 1.22 3.54 1.38 1.02 9.04 7.78
132 Fund Name 0.10 1.88 4.47 1.28 0.93 9.29 7.77
133 Fund Name 0.40 1.37 3.86 3.39 0.13 6.49 7.77
134 Fund Name 0.42 1.11 3.08 3.43 0.33 5.52 7.76
135 Fund Name 0.19 2.60 5.33 1.32 0.23 7.96 7.75
136 Fund Name 0.17 1.13 3.50 2.59 0.51 7.16 7.72
137 Fund Name 0.54 1.41 3.52 3.22 0.11 6.00 7.72
138 Fund Name 0.33 1.08 3.45 3.79 0.32 6.62 7.68
139 Fund Name 0.19 2.60 5.20 1.25 0.36 7.82 7.66
140 Fund Name 0.12 1.06 3.60 2.45 0.65 7.38 7.65
141 Fund Name 0.22 1.14 3.42 2.83 0.30 6.87 7.62
142 Fund Name 0.07 1.75 4.37 1.20 1.25 9.26 7.61
143 Fund Name 0.45 1.35 3.51 3.15 0.23 6.12 7.59
144 Fund Name 0.22 1.18 3.58 2.87 1.10 6.96 7.56
145 Fund Name 0.42 1.10 2.86 3.06 0.58 5.27 7.54
146 Fund Name 0.40 1.37 3.68 3.13 0.28 6.33 7.53
147 Fund Name 0.27 1.02 3.56 3.90 0.21 7.00 7.50
148 Fund Name 0.39 1.03 3.46 4.42 0.15 6.38 7.44
149 Fund Name 0.23 1.14 3.20 2.55 0.55 6.61 7.40
150 Fund Name 0.37 1.18 2.84 2.51 0.89 5.40 7.39
151 Fund Name 0.63 1.20 0.54 0.85 0.98 6.74 7.36
152 Fund Name 0.39 1.03 3.36 4.24 0.25 6.27 7.33
153 Fund Name 0.50 1.06 3.29 4.45 0.22 6.07 7.32
154 Fund Name 0.27 1.01 3.36 3.61 0.35 6.81 7.29
155 Fund Name 0.33 1.08 3.06 3.14 0.76 6.15 7.28
156 Fund Name 0.50 1.07 3.23 4.30 0.32 5.97 7.26
157 Fund Name 0.85 1.46 0.01 0.79 1.49 10.83 7.26
158 Fund Name 0.44 1.34 3.18 2.68 0.39 5.82 7.24
159 Fund Name 0.10 1.16 3.21 1.68 1.00 7.47 7.23
160 Fund Name 0.55 1.44 3.12 2.48 0.66 5.46 7.22
161 Fund Name 0.30 1.14 2.80 2.31 0.20 6.13 7.19
162 Fund Name 0.29 1.38 3.60 2.52 0.23 6.19 6.99
163 Fund Name 0.22 1.31 2.82 1.57 0.29 5.77 6.97
164 Fund Name 0.28 1.38 3.35 2.25 0.46 5.97 6.73
165 Fund Name 0.19 1.02 2.45 1.80 0.40 5.19 6.62
166 Fund Name 0.31 1.16 2.12 1.30 0.97 5.31 6.50
167 Fund Name 0.22 1.30 2.08 0.75 1.01 5.03 6.20
168 Fund Name 0.19 1.02 1.76 0.88 1.10 4.42 5.92
169 Fund Name 0.87 1.00 9.52 -0.29 2.19 -3.91 4.97
170 Fund Name 0.92 1.07 4.11 -0.52 1.44 -6.98 4.60
171 Fund Name 0.90 1.02 4.25 -0.50 1.83 -3.68 3.19
172 Fund Name 0.99 1.00 2.91 0.21 0.05 9.39 NA
173 Fund Name 0.99 1.00 2.99 0.21 0.10 9.50 NA
174 Fund Name 0.67 1.22 2.11 1.38 0.49 11.40 NA
175 Fund Name 0.67 1.23 0.84 0.96 1.39 10.37 NA
176 Fund Name 0.98 1.01 4.86 0.24 0.36 16.30 NA
177 Fund Name 0.98 1.01 3.41 0.17 1.77 14.54 NA
178 Fund Name 0.85 1.06 3.62 0.16 0.88 16.81 NA
179 Fund Name 0.85 1.06 2.88 0.13 1.38 16.23 NA
top.mf <- filter_ctr(aa.mf, avg.values)
top.mf <- top.mf[top.mf$plus_ctr >= 4,]
rownames(top.mf) <- NULL
value.string <- paste0("R-Sq:",round(analysis.df$avg[1], digits = 2),", Beta:-",
                       round(analysis.df$avg[2], digits = 2),", Alpha:-",
                       round(analysis.df$avg[3], digits = 2),", Sharpe Ratio:-",
                       round(analysis.df$avg[4], digits = 2),", Expense Ratio:-",
                       round(analysis.df$avg[5], digits = 2))
value.string <- paste("MF's Meeting Average Values of Four our of Five Criteria ",  value.string)
row.ctr <- nrow(top.mf)
paste(colFmt(value.string, "blue"))

[1] “MF’s Meeting Average Values of Four our of Five Criteria R-Sq:0.68, Beta:-0.76, Alpha:–0.46, Sharpe Ratio:-0.44, Expense Ratio:-1.21

top.mf[1:row.ctr,c(1,37,35,36,33,6,7,22)] %>%
  mutate(
    Ser.No = row.names(.),
    Fund = ('Fund Name'),
    R_Sq = color_tile("white", "orange")(`R-Squared`),
    Beta = color_tile("white", "green")(Beta),
    Alpha = color_tile("white", "blue")(Alpha),
    Sharpe_Ratio = color_tile("white", "purple")(`Sharpe Ratio`),
    Exp_Ratio = (`Expense Ratio (%)`),
    Return_1Yr =color_tile("white", "red")(`1 Yr Ret (%).x`),
    Return_5Yr =color_tile("white", "red")(`5 Yr Ret (%)`),
    
  ) %>%
  select(Ser.No,Fund, R_Sq, Beta, Alpha, Sharpe_Ratio, Exp_Ratio, Return_1Yr, Return_5Yr) %>%
  kable(escape = F) %>%
  kable_styling("hover", full_width = T) %>%
  scroll_box(width = "100%", height = "300px")
Ser.No Fund R_Sq Beta Alpha Sharpe_Ratio Exp_Ratio Return_1Yr Return_5Yr
1 Fund Name 0.82 0.93 10.62 0.49 0.88 29.97 18.04
2 Fund Name 0.81 0.84 0.45 0.95 1.59 47.09 17.61
3 Fund Name 0.82 0.93 9.92 0.46 1.38 29.33 17.50
4 Fund Name 0.93 0.89 5.53 0.17 1.10 0.72 17.39
5 Fund Name 0.95 1.02 3.18 0.19 0.79 16.77 17.25
6 Fund Name 0.87 0.93 -0.34 0.95 1.96 51.39 16.72
7 Fund Name 0.88 1.00 5.95 0.27 0.57 25.68 16.71
8 Fund Name 0.89 1.04 6.89 0.30 0.90 18.68 15.85
9 Fund Name 0.90 0.94 4.79 0.24 0.66 9.64 15.81
10 Fund Name 0.92 0.83 10.11 0.13 0.96 17.26 15.58
11 Fund Name 0.85 0.79 7.92 0.44 1.01 27.25 15.13
12 Fund Name 0.95 0.84 1.83 0.05 1.16 -0.66 15.05
13 Fund Name 0.92 0.78 0.15 1.00 1.69 37.09 14.79
14 Fund Name 0.91 0.99 0.93 0.09 0.77 18.35 14.18
15 Fund Name 0.90 0.77 5.72 0.12 1.10 7.45 14.11
16 Fund Name 0.94 1.02 1.36 0.13 0.56 14.38 14.09
17 Fund Name 0.97 0.86 4.75 0.33 0.87 16.45 14.08
18 Fund Name 0.91 0.98 1.27 0.07 0.80 8.91 13.84
19 Fund Name 0.94 0.92 1.54 0.09 0.84 8.74 13.84
20 Fund Name 0.99 0.99 0.80 0.11 0.58 9.42 13.80
21 Fund Name 0.96 0.84 2.94 0.08 0.90 17.37 13.73
22 Fund Name 0.88 0.95 0.43 0.07 0.95 8.19 13.60
23 Fund Name 0.86 0.97 7.18 0.33 0.57 20.47 13.55
24 Fund Name 0.92 0.79 6.81 0.16 0.64 4.09 13.40
25 Fund Name 0.98 0.89 0.73 0.17 0.39 11.12 13.37
26 Fund Name 0.97 0.99 1.37 0.13 1.05 8.23 13.36
27 Fund Name 0.90 0.85 4.08 0.23 0.88 8.49 13.33
28 Fund Name 0.84 0.88 4.05 0.21 0.81 8.54 13.05
29 Fund Name 0.95 1.01 4.86 0.23 0.52 25.97 12.94
30 Fund Name 0.95 0.85 4.06 0.13 0.74 17.49 12.78
31 Fund Name 0.96 0.95 0.43 0.07 0.82 10.34 12.68
32 Fund Name 0.96 0.86 4.28 0.24 0.86 16.09 12.67
33 Fund Name 0.97 0.92 2.46 0.05 0.61 13.65 12.64
34 Fund Name 0.92 0.94 2.00 0.16 0.81 12.10 12.63
35 Fund Name 0.98 0.95 0.56 0.04 0.70 6.21 12.60
36 Fund Name 0.97 0.96 2.74 0.15 1.00 10.45 12.51
37 Fund Name 0.99 1.00 2.94 0.21 0.07 9.48 12.50
38 Fund Name 0.96 0.95 1.29 0.11 0.54 5.57 12.46
39 Fund Name 0.97 1.01 0.15 0.02 0.93 7.44 12.44
40 Fund Name 0.99 1.00 2.90 0.20 0.07 9.39 12.44
41 Fund Name 0.99 1.00 2.92 0.21 0.07 9.46 12.44
42 Fund Name 0.96 0.99 -0.05 0.01 0.73 7.68 12.37
43 Fund Name 0.92 0.98 2.12 0.11 0.98 9.65 12.36
44 Fund Name 0.99 0.99 2.87 0.20 0.08 9.51 12.36
45 Fund Name 0.93 0.77 2.34 0.29 0.85 15.14 12.24
46 Fund Name 0.99 1.00 2.71 0.20 0.28 9.21 12.22
47 Fund Name 0.99 1.00 2.61 0.19 0.10 8.92 12.20
48 Fund Name 0.99 0.98 2.78 0.20 0.05 9.43 12.18
49 Fund Name 0.97 0.89 9.39 0.08 0.70 22.08 12.13
50 Fund Name 0.96 0.95 1.41 0.08 0.94 9.32 12.11
51 Fund Name 0.99 1.00 2.42 0.18 0.30 8.64 12.00
52 Fund Name 0.89 0.95 -0.06 0.01 0.84 12.07 11.98
53 Fund Name 0.99 1.01 1.03 0.12 0.07 7.86 11.96
54 Fund Name 0.99 0.98 2.67 0.20 0.10 9.36 11.94
55 Fund Name 0.98 0.98 1.95 0.16 1.05 10.18 11.90
56 Fund Name 0.97 0.92 6.63 -0.03 1.18 15.28 11.89
57 Fund Name 0.97 0.93 0.39 0.03 0.69 9.25 11.86
58 Fund Name 0.69 1.58 3.05 0.44 0.34 19.23 11.73
59 Fund Name 1.00 1.01 1.01 0.11 0.07 8.16 11.73
60 Fund Name 1.00 1.01 1.02 0.12 0.07 8.18 11.69
61 Fund Name 0.96 0.94 1.33 0.12 0.91 11.78 11.66
62 Fund Name 1.00 1.01 0.95 0.11 0.10 8.16 11.63
63 Fund Name 0.99 1.01 1.00 0.11 0.05 8.22 11.62
64 Fund Name 0.86 0.92 0.13 0.12 0.87 10.40 11.60
65 Fund Name 0.98 0.97 2.26 0.18 1.00 8.40 11.59
66 Fund Name 0.99 0.99 1.06 0.12 0.15 8.94 11.55
67 Fund Name 1.00 1.01 1.05 0.12 0.05 8.24 11.55
68 Fund Name 0.96 0.84 1.41 0.14 1.08 9.65 11.54
69 Fund Name 1.00 1.00 0.91 0.11 0.05 8.23 11.52
70 Fund Name 0.99 0.99 2.30 0.18 0.57 9.16 11.51
71 Fund Name 1.00 1.01 0.91 0.11 0.09 8.12 11.49
72 Fund Name 0.95 0.92 2.28 0.04 0.71 17.43 11.43
73 Fund Name 0.99 0.99 0.93 0.11 0.30 8.75 11.42
74 Fund Name 1.00 1.01 0.85 0.11 0.10 8.03 11.42
75 Fund Name 1.00 1.01 0.80 0.10 0.10 7.81 11.34
76 Fund Name 1.00 1.01 0.79 0.10 0.14 7.97 11.34
77 Fund Name 0.99 0.98 0.80 0.11 0.05 8.00 11.32
78 Fund Name 1.00 1.00 -0.22 0.06 0.14 8.14 11.31
79 Fund Name 0.99 0.96 0.92 0.11 0.93 9.09 11.28
80 Fund Name 0.99 0.98 2.04 0.17 0.61 8.94 11.27
81 Fund Name 1.00 1.01 0.92 0.11 0.12 8.08 11.25
82 Fund Name 0.94 1.06 0.15 0.06 0.85 0.01 11.24
83 Fund Name 0.88 0.80 3.46 1.67 0.48 13.96 11.20
84 Fund Name 1.00 1.01 0.60 0.10 0.09 7.55 11.20
85 Fund Name 0.99 1.00 0.67 0.10 0.10 8.13 11.18
86 Fund Name 0.99 0.97 1.24 0.13 1.05 10.57 11.16
87 Fund Name 1.00 1.01 0.61 0.10 0.30 7.61 11.15
88 Fund Name 0.92 1.01 -0.16 0.11 0.92 10.96 11.13
89 Fund Name 0.99 1.00 0.69 0.10 0.10 7.95 11.12
90 Fund Name 1.00 1.00 0.72 0.10 0.30 8.06 11.11
91 Fund Name 0.93 0.77 1.77 1.32 0.62 12.47 11.11
92 Fund Name 0.88 0.80 3.36 1.65 0.61 13.81 11.06
93 Fund Name 1.00 0.98 -0.29 0.05 0.46 7.45 11.04
94 Fund Name 0.90 0.86 2.31 0.26 0.78 12.44 10.98
95 Fund Name 0.99 0.99 1.85 0.16 1.08 8.82 10.97
96 Fund Name 0.69 1.58 2.32 0.38 1.05 18.69 10.96
97 Fund Name 0.93 0.94 5.78 0.18 0.69 38.23 10.93
98 Fund Name 0.52 0.81 3.21 1.98 0.73 13.41 10.90
99 Fund Name 1.00 1.01 0.68 0.10 0.05 7.91 10.86
100 Fund Name 0.76 0.63 2.88 1.59 0.33 12.09 10.86
101 Fund Name 0.96 0.99 0.74 0.08 1.13 8.07 10.86
102 Fund Name 0.87 0.82 2.23 1.36 0.23 14.09 10.84
103 Fund Name 0.95 0.88 0.13 0.13 1.08 5.57 10.84
104 Fund Name 0.99 0.99 0.26 0.08 0.26 7.81 10.81
105 Fund Name 0.99 0.93 0.65 0.10 1.07 12.75 10.81
106 Fund Name 0.99 0.98 0.37 0.08 0.50 7.36 10.80
107 Fund Name 0.99 1.01 0.34 0.08 0.48 7.88 10.76
108 Fund Name 0.99 1.00 0.26 0.08 0.45 7.71 10.75
109 Fund Name 0.99 0.99 0.20 0.08 0.33 7.89 10.71
110 Fund Name 1.00 1.01 0.18 0.08 0.48 7.09 10.71
111 Fund Name 0.94 0.83 0.32 0.03 1.13 11.90 10.69
112 Fund Name 0.91 0.82 -0.32 0.09 1.03 6.83 10.67
113 Fund Name 0.87 0.82 2.03 1.31 0.39 13.91 10.60
114 Fund Name 0.95 0.85 7.88 0.72 1.16 58.29 10.56
115 Fund Name 0.99 0.96 0.59 0.10 1.11 8.90 10.56
116 Fund Name 0.90 0.84 1.89 1.30 0.61 14.89 10.55
117 Fund Name 0.95 0.93 2.89 0.07 1.21 14.90 10.54
118 Fund Name 0.97 0.85 -0.07 -0.27 0.83 4.00 10.52
119 Fund Name 0.76 0.63 2.55 1.50 0.64 11.75 10.49
120 Fund Name 0.99 0.99 0.00 0.07 0.58 7.71 10.46
121 Fund Name 0.96 0.87 3.89 -0.12 0.91 5.66 10.40
122 Fund Name 0.98 0.93 -0.46 0.04 0.90 6.49 10.39
123 Fund Name 0.68 1.08 2.28 1.54 0.80 13.42 10.36
124 Fund Name 0.84 0.77 0.84 1.03 0.58 12.40 10.33
125 Fund Name 0.99 0.99 -0.19 0.06 0.67 7.27 10.32
126 Fund Name 0.99 1.00 -0.12 0.06 1.18 6.85 10.32
127 Fund Name 0.88 0.79 1.73 1.27 0.54 13.86 10.31
128 Fund Name 0.67 1.14 2.77 1.64 0.45 12.30 10.31
129 Fund Name 0.96 0.86 -0.28 -0.06 1.08 8.16 10.28
130 Fund Name 0.83 0.61 1.83 0.63 1.13 10.37 10.23
131 Fund Name 0.99 1.00 -0.15 0.06 1.03 7.48 10.22
132 Fund Name 0.87 0.75 1.02 1.11 0.47 12.92 10.22
133 Fund Name 0.77 0.72 1.03 1.05 0.60 14.11 10.14
134 Fund Name 0.83 0.87 0.53 0.30 1.05 10.48 10.09
135 Fund Name 0.92 0.77 0.80 1.08 1.59 11.42 9.98
136 Fund Name 0.92 0.77 0.81 1.08 1.71 11.43 9.98
137 Fund Name 0.80 1.51 1.61 1.22 0.87 12.01 9.97
138 Fund Name 0.84 1.77 1.61 1.17 0.86 13.89 9.95
139 Fund Name 0.62 1.12 2.31 1.45 0.85 14.26 9.95
140 Fund Name 0.86 0.82 0.83 1.04 0.45 13.38 9.94
141 Fund Name 0.86 0.82 0.83 1.04 0.40 13.38 9.94
142 Fund Name 1.00 1.00 -0.26 0.05 1.03 7.17 9.92
143 Fund Name 0.90 0.84 1.29 1.16 1.23 14.19 9.90
144 Fund Name 0.83 0.90 0.91 0.35 1.10 11.65 9.87
145 Fund Name 0.68 1.33 2.42 1.42 0.25 13.78 9.85
146 Fund Name 0.84 0.77 0.25 0.90 1.18 11.72 9.73
147 Fund Name 0.84 1.36 1.30 1.20 0.87 10.21 9.70
148 Fund Name 0.97 0.92 5.62 -0.07 1.06 23.31 9.68
149 Fund Name 0.87 0.73 0.69 1.03 0.57 12.72 9.66
150 Fund Name 0.87 0.79 1.04 1.10 1.07 13.21 9.65
151 Fund Name 0.87 0.75 0.50 0.98 0.95 12.40 9.65
152 Fund Name 0.67 1.14 2.15 1.43 1.15 11.56 9.63
153 Fund Name 0.69 0.59 2.34 1.41 0.89 13.32 9.60
154 Fund Name 0.68 1.08 1.58 1.28 1.52 12.66 9.59
155 Fund Name 0.95 0.85 7.01 0.68 2.19 56.92 9.59
156 Fund Name 0.79 0.73 0.40 0.91 0.65 10.64 9.59
157 Fund Name 0.76 0.73 0.52 0.92 1.21 13.57 9.54
158 Fund Name 0.97 1.09 0.44 0.03 1.08 3.22 9.52
159 Fund Name 0.86 0.58 0.98 0.45 0.76 8.39 9.50
160 Fund Name 0.84 0.67 1.57 1.27 0.76 11.64 9.49
161 Fund Name 0.86 1.75 1.07 1.06 0.72 11.62 9.44
162 Fund Name 0.87 0.72 -0.25 0.79 0.44 10.72 9.43
163 Fund Name 0.06 2.57 7.95 1.58 0.20 14.08 9.38
164 Fund Name 0.02 0.83 4.73 1.98 0.40 11.50 9.38
165 Fund Name 0.79 0.75 1.01 1.05 0.40 13.45 9.36
166 Fund Name 0.85 1.78 0.86 1.00 1.35 12.22 9.36
167 Fund Name 0.84 1.38 1.41 1.23 0.96 10.97 9.35
168 Fund Name 0.87 0.91 -0.49 0.75 0.30 12.28 9.33
169 Fund Name 0.05 1.52 5.43 1.75 0.35 11.15 9.32
170 Fund Name 0.79 0.73 0.11 0.84 0.93 10.33 9.29
171 Fund Name 0.79 1.64 1.00 1.01 0.42 12.94 9.21
172 Fund Name 0.57 0.82 2.43 1.71 0.30 11.88 9.20
173 Fund Name 0.71 1.63 1.87 1.18 0.29 13.62 9.19
174 Fund Name 0.79 1.52 0.87 1.00 1.64 11.27 9.19
175 Fund Name 0.04 1.46 5.57 1.68 0.34 10.94 9.18
176 Fund Name 0.88 0.77 4.26 0.15 0.57 21.62 9.15
177 Fund Name 0.61 1.13 1.83 1.27 0.56 12.46 9.14
178 Fund Name 0.02 1.11 4.69 1.39 0.36 11.01 9.12
179 Fund Name 0.91 0.83 0.60 0.05 1.18 7.54 9.12
180 Fund Name 0.11 2.36 6.58 1.77 0.31 11.27 9.11
181 Fund Name 0.87 0.91 -0.72 0.71 0.50 12.05 9.08
182 Fund Name 0.84 1.77 0.86 0.99 1.70 13.00 9.08
183 Fund Name 0.86 0.76 2.24 0.63 0.75 13.29 9.07
184 Fund Name 0.06 2.59 7.69 1.49 0.55 13.68 9.07
185 Fund Name 0.54 0.96 1.70 1.25 0.28 11.09 9.07
186 Fund Name 0.51 1.36 1.77 1.06 0.49 13.39 9.06
187 Fund Name 0.57 0.83 2.28 1.64 0.60 11.62 9.06
188 Fund Name 0.06 1.42 5.37 2.12 0.34 10.85 9.06
189 Fund Name 0.04 1.11 5.05 2.20 0.30 11.01 9.05
190 Fund Name 0.80 1.37 1.34 1.18 0.75 11.24 9.02
191 Fund Name 0.04 1.26 5.54 2.04 0.34 10.91 9.01
192 Fund Name 0.13 2.58 6.63 1.69 0.19 9.62 8.99
193 Fund Name 0.05 1.53 5.13 1.61 0.68 10.78 8.98
194 Fund Name 0.67 1.34 1.71 1.20 0.67 13.29 8.98
195 Fund Name 0.13 2.23 6.52 2.07 0.31 9.86 8.94
196 Fund Name 0.02 1.03 4.18 1.40 0.37 10.27 8.94
197 Fund Name 0.71 1.08 0.65 0.96 0.63 10.64 8.94
198 Fund Name 0.14 2.52 6.30 1.62 0.32 10.88 8.92
199 Fund Name 0.81 1.57 0.97 1.03 0.80 12.66 8.88
200 Fund Name 0.05 1.49 5.05 1.66 0.21 10.75 8.87
201 Fund Name 0.90 1.34 0.17 0.24 0.92 7.97 8.86
202 Fund Name 0.13 2.78 7.39 1.79 0.30 11.21 8.86
203 Fund Name 0.69 0.95 1.97 1.54 0.76 10.97 8.86
204 Fund Name 0.17 2.52 6.81 2.05 0.30 6.49 8.84
205 Fund Name 0.11 2.20 6.09 1.72 0.17 10.90 8.83
206 Fund Name 0.86 0.82 -0.19 0.81 1.40 12.24 8.83
207 Fund Name 0.71 1.08 0.54 0.92 0.75 10.49 8.83
208 Fund Name 0.88 0.87 1.01 0.38 0.74 10.33 8.82
209 Fund Name 0.86 0.82 -0.19 0.81 1.52 12.24 8.82
210 Fund Name 0.79 0.75 0.52 0.93 1.00 12.90 8.81
211 Fund Name 0.08 1.92 5.74 1.66 0.32 10.58 8.81
212 Fund Name 0.04 1.48 5.24 1.53 0.76 10.55 8.80
213 Fund Name 0.88 0.89 -1.26 0.59 0.79 10.06 8.79
214 Fund Name 0.89 0.63 0.50 1.01 0.25 10.61 8.78
215 Fund Name 0.89 0.85 -1.28 0.58 0.48 9.09 8.77
216 Fund Name 0.11 2.37 6.20 1.60 0.80 10.73 8.77
217 Fund Name 0.12 2.01 5.55 1.77 0.34 10.30 8.74
218 Fund Name 0.69 1.23 0.99 1.02 1.09 13.16 8.72
219 Fund Name 0.93 0.87 -0.48 0.77 0.27 10.97 8.70
220 Fund Name 0.13 2.24 6.24 1.93 0.62 9.53 8.68
221 Fund Name 0.02 1.11 4.24 1.21 0.81 10.51 8.68
222 Fund Name 0.09 1.71 5.41 1.90 0.28 10.26 8.67
223 Fund Name 0.54 0.97 1.35 1.12 0.52 10.85 8.66
224 Fund Name 0.74 1.64 0.10 0.76 0.25 11.18 8.65
225 Fund Name 0.09 1.55 5.44 2.26 0.28 9.23 8.64
226 Fund Name 0.06 1.44 4.74 1.71 0.34 10.19 8.64
227 Fund Name 0.03 0.96 4.40 1.81 0.22 11.71 8.62
228 Fund Name 0.13 2.79 7.11 1.68 0.65 10.82 8.61
229 Fund Name 0.10 1.89 5.21 1.65 0.30 9.99 8.60
230 Fund Name 0.83 1.43 -0.02 0.77 0.88 10.24 8.59
231 Fund Name 0.13 2.50 5.98 1.50 0.54 10.58 8.59
232 Fund Name 0.71 1.63 1.57 1.11 0.63 13.25 8.59
233 Fund Name 0.83 1.36 0.42 0.91 1.76 9.20 8.59
234 Fund Name 0.17 2.67 6.75 1.86 0.75 5.98 8.59
235 Fund Name 0.92 0.75 -0.11 0.85 1.08 10.51 8.57
236 Fund Name 0.06 1.23 4.25 1.81 0.42 9.74 8.57
237 Fund Name 0.13 2.57 6.26 1.54 0.50 9.27 8.57
238 Fund Name 0.85 1.78 0.21 0.84 1.97 11.53 8.57
239 Fund Name 0.51 1.35 1.24 0.93 1.16 12.66 8.56
240 Fund Name 0.61 1.13 1.27 1.08 1.13 11.87 8.56
241 Fund Name 0.83 0.54 0.11 0.87 0.44 10.71 8.55
242 Fund Name 0.02 1.04 3.76 1.21 0.83 9.78 8.55
243 Fund Name 0.86 1.76 0.29 0.86 1.76 10.72 8.55
244 Fund Name 0.62 0.77 1.84 1.57 0.35 10.38 8.54
245 Fund Name 0.80 1.23 0.33 0.88 0.51 10.39 8.53
246 Fund Name 0.48 1.05 1.82 1.17 0.40 9.25 8.53
247 Fund Name 0.02 0.83 3.93 1.56 1.16 10.66 8.52
248 Fund Name 0.17 2.22 5.83 2.01 0.25 10.10 8.52
249 Fund Name 0.07 0.80 3.96 3.06 0.19 8.85 8.51
250 Fund Name 0.84 1.38 0.64 0.98 1.62 10.24 8.48
251 Fund Name 0.01 0.91 4.18 1.31 0.35 11.17 8.46
252 Fund Name 0.07 1.76 5.23 1.61 0.40 10.19 8.43
253 Fund Name 0.04 1.26 5.05 1.80 0.81 10.39 8.43
254 Fund Name 0.78 1.64 0.30 0.83 0.89 12.34 8.39
255 Fund Name 0.11 2.20 5.69 1.54 0.55 10.47 8.38
256 Fund Name 0.05 1.49 4.63 1.46 0.61 10.31 8.37
257 Fund Name 0.24 0.78 0.71 0.63 0.45 10.43 8.37
258 Fund Name 0.63 1.02 0.63 0.91 0.16 10.54 8.33
259 Fund Name 0.82 0.82 -0.27 0.09 0.34 9.33 8.31
260 Fund Name 0.04 1.13 4.40 1.81 1.01 10.25 8.30
261 Fund Name 0.08 1.92 5.23 1.43 0.78 10.06 8.27
262 Fund Name 0.06 0.79 3.72 2.82 0.36 8.64 8.26
263 Fund Name 0.11 0.93 3.99 3.33 0.30 7.90 8.16
264 Fund Name 0.69 0.94 1.31 1.26 1.44 10.23 8.16
265 Fund Name 0.02 1.00 4.95 1.63 0.23 10.13 8.16
266 Fund Name 0.63 1.21 1.17 1.04 0.23 7.54 8.15
267 Fund Name 0.03 0.94 3.96 1.58 0.57 11.29 8.15
268 Fund Name 0.11 2.01 5.00 1.48 0.84 9.75 8.15
269 Fund Name 0.06 1.41 4.53 1.66 1.14 9.95 8.12
270 Fund Name 0.09 1.72 4.91 1.63 0.80 9.69 8.11
271 Fund Name 0.83 0.54 -0.28 0.74 0.90 10.23 8.10
272 Fund Name 0.80 1.36 0.35 0.87 1.88 10.05 8.03
273 Fund Name 0.11 1.05 3.90 2.75 0.32 7.71 8.03
274 Fund Name 0.80 0.80 10.84 -0.33 1.15 -2.24 8.01
275 Fund Name 0.96 0.90 4.02 0.53 1.84 63.60 8.00
276 Fund Name 0.10 1.17 3.98 2.32 0.21 8.36 7.99
277 Fund Name 0.80 0.80 -0.09 0.19 0.66 10.94 7.99
278 Fund Name 0.17 2.21 5.33 1.72 0.75 9.56 7.98
279 Fund Name 0.09 1.55 4.87 1.92 0.83 8.65 7.97
280 Fund Name 0.87 1.45 0.16 0.85 0.18 9.94 7.96
281 Fund Name 0.14 1.71 3.86 1.37 0.13 8.16 7.95
282 Fund Name 0.73 1.63 -0.54 0.59 0.68 10.57 7.95
283 Fund Name 0.85 1.54 0.06 0.80 0.95 9.43 7.92
284 Fund Name 0.17 1.13 3.72 2.83 0.28 7.40 7.92
285 Fund Name 0.37 1.17 3.36 3.39 0.24 6.05 7.88
286 Fund Name 0.90 1.66 0.08 0.83 1.23 9.84 7.87
287 Fund Name 0.48 1.05 1.31 1.00 0.90 8.70 7.87
288 Fund Name 0.81 1.57 -0.01 0.76 1.54 11.46 7.86
289 Fund Name 0.19 1.08 3.82 3.27 0.40 7.62 7.83
290 Fund Name 0.29 0.98 3.37 3.97 0.23 6.62 7.82
291 Fund Name 0.85 1.46 0.29 0.87 1.28 11.15 7.79
292 Fund Name 0.62 0.77 1.13 1.23 1.02 9.62 7.78
293 Fund Name 0.06 1.22 3.54 1.38 1.02 9.04 7.78
294 Fund Name 0.01 0.85 3.35 1.00 1.05 10.35 7.77
295 Fund Name 0.10 1.88 4.47 1.28 0.93 9.29 7.77
296 Fund Name 0.40 1.37 3.86 3.39 0.13 6.49 7.77
297 Fund Name 0.42 1.11 3.08 3.43 0.33 5.52 7.76
298 Fund Name 0.19 2.60 5.33 1.32 0.23 7.96 7.75
299 Fund Name 0.17 1.13 3.50 2.59 0.51 7.16 7.72
300 Fund Name 0.54 1.41 3.52 3.22 0.11 6.00 7.72
301 Fund Name 0.11 0.92 3.59 2.88 0.61 7.57 7.70
302 Fund Name 0.02 0.99 4.51 1.45 0.65 9.61 7.69
303 Fund Name 0.33 1.08 3.45 3.79 0.32 6.62 7.68
304 Fund Name 0.19 2.60 5.20 1.25 0.36 7.82 7.66
305 Fund Name 0.12 1.06 3.60 2.45 0.65 7.38 7.65
306 Fund Name 0.69 1.24 -0.08 0.68 1.94 12.21 7.64
307 Fund Name 0.25 0.93 3.58 4.35 0.21 7.05 7.63
308 Fund Name 0.22 1.14 3.42 2.83 0.30 6.87 7.62
309 Fund Name 0.45 1.35 3.51 3.15 0.23 6.12 7.59
310 Fund Name 0.88 0.92 0.56 -0.03 0.98 1.09 7.57
311 Fund Name 0.22 1.18 3.58 2.87 1.10 6.96 7.56
312 Fund Name 0.42 1.10 2.86 3.06 0.58 5.27 7.54
313 Fund Name 0.40 1.37 3.68 3.13 0.28 6.33 7.53
314 Fund Name 0.02 1.36 3.08 0.50 0.28 10.84 7.53
315 Fund Name 0.25 0.93 3.46 4.15 0.34 6.92 7.51
316 Fund Name 0.27 1.02 3.56 3.90 0.21 7.00 7.50
317 Fund Name 0.27 0.85 3.24 4.39 0.17 6.43 7.45
318 Fund Name 0.39 1.03 3.46 4.42 0.15 6.38 7.44
319 Fund Name 0.32 0.92 3.33 4.46 0.31 6.41 7.44
320 Fund Name 0.24 0.86 3.26 4.06 0.21 6.65 7.43
321 Fund Name 0.23 1.14 3.20 2.55 0.55 6.61 7.40
322 Fund Name 0.95 0.92 4.30 -0.11 0.68 10.83 7.40
323 Fund Name 0.37 1.18 2.84 2.51 0.89 5.40 7.39
324 Fund Name 0.63 1.20 0.54 0.85 0.98 6.74 7.36
325 Fund Name 0.87 1.44 -0.47 0.65 1.08 9.21 7.34
326 Fund Name 0.39 1.03 3.36 4.24 0.25 6.27 7.33
327 Fund Name 0.27 0.84 3.12 4.19 0.27 6.32 7.33
328 Fund Name 0.24 0.86 3.14 3.85 0.33 6.52 7.32
329 Fund Name 0.50 1.06 3.29 4.45 0.22 6.07 7.32
330 Fund Name 0.32 0.92 3.19 4.19 0.49 6.23 7.31
331 Fund Name 0.27 1.01 3.36 3.61 0.35 6.81 7.29
332 Fund Name 0.33 1.08 3.06 3.14 0.76 6.15 7.28
333 Fund Name 0.50 1.07 3.23 4.30 0.32 5.97 7.26
334 Fund Name 0.85 1.46 0.01 0.79 1.49 10.83 7.26
335 Fund Name 0.44 1.34 3.18 2.68 0.39 5.82 7.24
336 Fund Name 0.10 1.16 3.21 1.68 1.00 7.47 7.23
337 Fund Name 0.55 1.44 3.12 2.48 0.66 5.46 7.22
338 Fund Name 0.30 1.14 2.80 2.31 0.20 6.13 7.19
339 Fund Name 0.05 0.82 2.70 1.46 0.26 7.03 7.15
340 Fund Name 0.30 0.98 2.73 2.89 0.83 6.00 7.11
341 Fund Name 0.34 0.85 2.47 3.29 0.11 4.93 7.02
342 Fund Name 0.29 1.38 3.60 2.52 0.23 6.19 6.99
343 Fund Name 0.26 0.95 2.37 2.26 0.69 4.89 6.99
344 Fund Name 0.22 1.31 2.82 1.57 0.29 5.77 6.97
345 Fund Name 0.96 0.90 3.02 0.48 2.79 62.12 6.97
346 Fund Name 0.34 0.87 2.36 2.97 0.21 4.84 6.94
347 Fund Name 0.43 0.85 2.25 3.19 0.10 4.77 6.80
348 Fund Name 0.86 0.88 3.08 -0.51 0.86 -9.06 6.77
349 Fund Name 0.42 0.81 2.15 3.18 0.21 4.71 6.76
350 Fund Name 0.41 0.89 2.19 2.73 0.22 4.55 6.76
351 Fund Name 0.47 1.08 -0.40 0.46 0.76 10.93 6.76
352 Fund Name 0.44 0.80 2.19 3.40 0.13 4.87 6.76
353 Fund Name 0.44 0.85 2.18 3.10 0.20 4.67 6.75
354 Fund Name 0.44 0.85 2.15 2.98 0.18 4.66 6.73
355 Fund Name 0.28 1.38 3.35 2.25 0.46 5.97 6.73
356 Fund Name 0.43 0.85 2.19 3.01 0.19 4.69 6.73
357 Fund Name 0.44 0.83 2.12 3.03 0.11 4.73 6.72
358 Fund Name 0.47 0.87 2.18 3.03 0.21 4.74 6.72
359 Fund Name 0.44 0.84 2.12 3.00 0.20 4.70 6.70
360 Fund Name 0.40 0.85 2.14 2.83 0.08 4.55 6.69
361 Fund Name 0.39 0.85 1.99 2.46 0.12 4.30 6.69
362 Fund Name 0.35 0.78 1.97 2.64 0.15 4.35 6.69
363 Fund Name 0.41 0.82 2.08 2.91 0.17 4.58 6.69
364 Fund Name 0.43 0.87 2.11 2.74 0.15 4.54 6.68
365 Fund Name 0.95 0.92 0.20 -0.25 1.09 16.09 6.68
366 Fund Name 0.40 0.81 2.05 2.89 0.17 4.57 6.68
367 Fund Name 0.42 0.81 2.06 2.94 0.31 4.61 6.67
368 Fund Name 0.40 0.81 2.04 2.78 0.15 4.57 6.67
369 Fund Name 0.44 0.86 2.10 2.83 0.25 4.59 6.66
370 Fund Name 0.39 0.82 2.02 2.68 0.12 4.48 6.66
371 Fund Name 0.45 0.79 2.08 3.24 0.17 4.83 6.66
372 Fund Name 0.44 0.84 2.09 2.87 0.30 4.57 6.66
373 Fund Name 0.37 0.78 2.00 2.84 0.28 4.50 6.66
374 Fund Name 0.41 0.89 2.09 2.50 0.32 4.45 6.65
375 Fund Name 0.38 0.79 1.97 2.68 0.15 4.45 6.65
376 Fund Name 0.46 0.88 2.10 2.78 0.32 4.62 6.64
377 Fund Name 0.19 1.02 2.45 1.80 0.40 5.19 6.62
378 Fund Name 0.44 0.84 2.04 2.77 0.32 4.58 6.62
379 Fund Name 0.41 0.81 2.00 2.79 0.18 4.57 6.62
380 Fund Name 0.41 0.82 2.01 2.72 0.24 4.48 6.62
381 Fund Name 0.43 0.83 2.00 2.70 0.20 4.51 6.61
382 Fund Name 0.40 0.81 1.98 2.65 0.20 4.52 6.61
383 Fund Name 0.35 0.78 1.89 2.46 0.14 4.26 6.60
384 Fund Name 0.28 0.78 1.77 1.96 0.15 3.97 6.59
385 Fund Name 0.36 0.77 1.99 2.83 0.11 4.57 6.59
386 Fund Name 0.40 0.81 1.98 2.68 0.26 4.48 6.59
387 Fund Name 0.40 0.84 2.01 2.56 0.18 4.44 6.58
388 Fund Name 0.39 0.85 1.89 2.23 0.22 4.19 6.58
389 Fund Name 0.43 0.87 2.01 2.53 0.23 4.45 6.57
390 Fund Name 0.37 0.78 1.86 2.48 0.15 4.38 6.57
391 Fund Name 0.38 0.79 1.89 2.51 0.22 4.37 6.57
392 Fund Name 0.44 0.83 1.98 2.69 0.25 4.59 6.57
393 Fund Name 0.40 0.82 1.93 2.48 0.21 4.39 6.56
394 Fund Name 0.43 0.85 2.20 3.06 0.11 4.69 6.56
395 Fund Name 0.41 0.81 1.92 2.60 0.26 4.48 6.54
396 Fund Name 0.13 0.90 2.17 1.51 0.31 4.75 6.53
397 Fund Name 0.43 0.83 1.90 2.45 0.30 4.41 6.51
398 Fund Name 0.31 1.16 2.12 1.30 0.97 5.31 6.50
399 Fund Name 0.28 0.77 1.66 1.80 0.20 3.92 6.49
400 Fund Name 0.38 0.78 1.80 2.34 0.20 4.32 6.49
401 Fund Name 0.37 0.78 1.91 2.60 0.21 4.47 6.47
402 Fund Name 0.42 0.87 2.04 2.54 0.36 4.42 6.41
403 Fund Name 0.04 0.80 2.03 0.93 0.88 6.40 6.40
404 Fund Name 0.22 1.30 2.08 0.75 1.01 5.03 6.20
405 Fund Name 0.10 0.81 1.48 0.75 0.42 3.76 6.19
406 Fund Name 0.13 0.94 1.90 1.06 0.45 3.94 6.09
407 Fund Name 0.19 1.02 1.76 0.88 1.10 4.42 5.92
408 Fund Name 0.93 0.89 1.85 0.42 1.14 58.14 5.74
409 Fund Name 0.13 0.90 1.41 0.56 1.06 3.98 5.70
410 Fund Name 0.84 0.82 7.88 -0.28 1.09 4.25 5.06
411 Fund Name 0.91 0.86 1.26 0.20 1.07 9.43 NA
412 Fund Name 1.00 1.00 0.99 0.11 0.15 8.17 NA
413 Fund Name 0.92 0.78 2.13 0.27 0.77 9.75 NA
414 Fund Name 0.90 0.82 1.46 0.14 0.28 9.21 NA
415 Fund Name 1.00 1.01 1.02 0.12 0.05 8.17 NA
416 Fund Name 0.99 1.00 2.91 0.21 0.05 9.39 NA
417 Fund Name 0.99 0.98 2.35 0.18 0.30 9.57 NA
418 Fund Name 0.99 0.98 2.59 0.19 0.10 9.81 NA
419 Fund Name 1.00 0.99 0.99 0.11 0.06 8.37 NA
420 Fund Name 0.99 0.98 2.83 0.20 0.22 9.40 NA
421 Fund Name 1.00 0.99 -0.20 0.06 0.26 7.61 NA
422 Fund Name 1.00 1.01 1.07 0.12 0.10 8.41 NA
423 Fund Name 0.99 1.00 2.99 0.21 0.10 9.50 NA
424 Fund Name 0.96 0.93 0.88 0.06 0.86 12.24 NA
425 Fund Name 0.67 1.22 2.11 1.38 0.49 11.40 NA
426 Fund Name 0.98 1.01 4.86 0.24 0.36 16.30 NA
427 Fund Name 0.92 0.86 -0.17 0.84 0.10 11.00 NA
428 Fund Name 0.87 0.97 0.41 0.03 0.88 15.36 NA
429 Fund Name 0.85 1.06 3.62 0.16 0.88 16.81 NA
430 Fund Name 0.89 0.81 2.03 0.05 1.08 0.63 NA
431 Fund Name 0.93 0.97 -0.67 0.96 1.11 40.30 NA
432 Fund Name 0.94 0.81 6.49 0.67 1.20 55.36 NA
433 Fund Name 0.94 0.81 4.83 0.58 2.65 53.01 NA
pandoc.header(colFmt("1C: MF's filtered on Return and Holdings", 'blue'), 1, 'setext')

1C: MF’s filtered on Return and Holdings

top.mf <- aa.mf[, c(1,7,20,22,24,44)]
top.mf <- top.mf[order(top.mf, decreasing = TRUE),]
top.mf$aax <- top.mf$`10 Yr Ret (%)`
top.mf <- top.mf[1:15,]

rownames(top.mf) <- NULL
value.string <- paste("Top 15 MF's with highest 10 Year Return ")
row.ctr <- nrow(top.mf)
paste(colFmt(value.string, "blue"))

[1] “Top 15 MF’s with highest 10 Year Return

top.mf[1:row.ctr,] %>%
  mutate(
    Ser.No = row.names(.),
    Fund = (`Fund Name`),
    Return_1_Yr = color_tile("white", "orange")(`1 Yr Ret (%).x`),
    Return_3_Yr = color_tile("white", "green")(`3 Yr Ret (%)`),
    Return_5_Yr = color_tile("white", "blue")(`5 Yr Ret (%)`),
    Return_Ten_Yr = color_tile("white", "red")(aax),
    NAV = color_tile("white", "purple")('Net Assets (Cr).y')
    
  ) %>%
  select(Ser.No,Fund, Return_1_Yr, Return_3_Yr,Return_5_Yr,Return_Ten_Yr, NAV) %>%
  kable(escape = F) %>%
  kable_styling("hover", full_width = T) %>%
  scroll_box(width = "100%", height = "300px")
Ser.No Fund Return_1_Yr Return_3_Yr Return_5_Yr Return_Ten_Yr NAV
1 UTI Value Opportunities Fund - Regular Plan 12.71 6.68 9.17 9.23 Net Assets (Cr).y
2 UTI Value Opportunities Fund - Direct Plan 13.44 7.42 9.95 NA Net Assets (Cr).y
3 UTI Unit Linked Insurance Plan - Direct Plan 10.67 4.90 7.66 NA Net Assets (Cr).y
4 UTI Unit Linked Insurance Plan 9.85 4.24 7.00 7.73 Net Assets (Cr).y
5 UTI Ultra Short Term Fund - Regular Plan 5.49 5.18 6.25 7.55 Net Assets (Cr).y
6 UTI Ultra Short Term Fund - Direct 6.07 5.78 6.86 NA Net Assets (Cr).y
7 UTI Treasury Advantage Fund - Regular Plan 7.57 3.35 5.23 7.26 Net Assets (Cr).y
8 UTI Treasury Advantage Fund - Direct Plan 7.66 3.48 5.37 NA Net Assets (Cr).y
9 UTI Transportation and Logistics Fund - Regular Plan 2.36 -7.10 1.74 11.90 Net Assets (Cr).y
10 UTI Transportation and Logistics Fund - Direct Plan 3.44 -6.06 2.92 NA Net Assets (Cr).y
11 UTI Short Term Income Fund - Regular Plan 10.45 3.76 5.59 7.79 Net Assets (Cr).y
12 UTI Short Term Income Fund - Direct Plan 10.93 4.24 6.09 NA Net Assets (Cr).y
13 UTI Sensex Exchange Traded Fund 9.48 10.78 12.50 NA Net Assets (Cr).y
14 UTI Retirement Benefit Pension Fund - Regular Plan 9.27 2.25 6.49 7.15 Net Assets (Cr).y
15 UTI Retirement Benefit Pension Fund - Direct Plan 10.04 2.87 7.15 NA Net Assets (Cr).y
top.mf <- aa.mf[, c(1,7,20,22,24,44)]
top.mf <- top.mf[order(top.mf$`5 Yr Ret (%)`, decreasing = TRUE),]
top.mf$aax <- top.mf$`10 Yr Ret (%)`
top.mf <- top.mf[1:15,]

rownames(top.mf) <- NULL
value.string <- paste("Top 15 MF's with highest 5 Year Return ")
row.ctr <- nrow(top.mf)
paste(colFmt(value.string, "blue"))

[1] “Top 15 MF’s with highest 5 Year Return

top.mf[1:row.ctr,] %>%
  mutate(
    Ser.No = row.names(.),
    Fund = (`Fund Name`),
    Return_1_Yr = color_tile("white", "orange")(`1 Yr Ret (%).x`),
    Return_3_Yr = color_tile("white", "green")(`3 Yr Ret (%)`),
    Return_5_Yr = color_tile("white", "blue")(`5 Yr Ret (%)`),
    Return_Ten_Yr = color_tile("white", "red")(aax),
    NAV = color_tile("white", "purple")('Net Assets (Cr).y')
    
  ) %>%
  select(Ser.No,Fund, Return_1_Yr, Return_3_Yr,Return_5_Yr,Return_Ten_Yr, NAV) %>%
  kable(escape = F) %>%
  kable_styling("hover", full_width = T) %>%
  scroll_box(width = "100%", height = "300px")
Ser.No Fund Return_1_Yr Return_3_Yr Return_5_Yr Return_Ten_Yr NAV
1 SBI Tax Advantage Fund - Series III - Direct Plan 29.97 15.87 18.04 NA Net Assets (Cr).y
2 SBI Tax Advantage Fund - Series II 27.17 11.23 17.78 NA Net Assets (Cr).y
3 Aditya Birla Sun Life Digital India Fund - Direct Plan 47.09 25.52 17.61 NA Net Assets (Cr).y
4 SBI Tax Advantage Fund - Series III - Regular Plan 29.33 15.08 17.50 NA Net Assets (Cr).y
5 SBI Banking & Financial Services Fund - Direct Plan 0.72 10.46 17.39 NA Net Assets (Cr).y
6 Mirae Asset Emerging Bluechip Fund - Direct Plan 16.77 9.99 17.25 NA Net Assets (Cr).y
7 ICICI Prudential Technology Fund - Direct Plan 51.39 26.09 16.72 NA Net Assets (Cr).y
8 Quant Tax Plan - Direct Plan 25.68 10.59 16.71 NA Net Assets (Cr).y
9 Aditya Birla Sun Life Digital India Fund 45.67 24.32 16.61 13.83 Net Assets (Cr).y
10 Mirae Asset Emerging Bluechip Fund - Regular Plan 15.62 9.00 16.24 18.61 Net Assets (Cr).y
11 SBI Banking & Financial Services Fund - Regular Plan -0.42 9.17 16.14 NA Net Assets (Cr).y
12 Quant Tax Plan 23.44 9.35 15.89 7.85 Net Assets (Cr).y
13 IIFL Focused Equity Fund - Direct Plan 18.68 13.18 15.85 NA Net Assets (Cr).y
14 Axis Focused 25 Fund - Direct Plan 9.64 11.35 15.81 NA Net Assets (Cr).y
15 ICICI Prudential Technology Fund 50.48 25.05 15.79 16.67 Net Assets (Cr).y
top.mf <- aa.mf[, c(1,7,20,22,24,44)]
top.mf <- top.mf[order(top.mf$`3 Yr Ret (%)`, decreasing = TRUE),]
top.mf$aax <- top.mf$`10 Yr Ret (%)`
top.mf <- top.mf[1:15,]

rownames(top.mf) <- NULL
value.string <- paste("Top 15 MF's with highest 3 Year Return ")
row.ctr <- nrow(top.mf)
paste(colFmt(value.string, "blue"))

[1] “Top 15 MF’s with highest 3 Year Return

top.mf[1:row.ctr,] %>%
  mutate(
    Ser.No = row.names(.),
    Fund = (`Fund Name`),
    Return_1_Yr = color_tile("white", "orange")(`1 Yr Ret (%).x`),
    Return_3_Yr = color_tile("white", "green")(`3 Yr Ret (%)`),
    Return_5_Yr = color_tile("white", "blue")(`5 Yr Ret (%)`),
    Return_Ten_Yr = color_tile("white", "red")(aax),
    NAV = color_tile("white", "purple")('Net Assets (Cr).y')
    
  ) %>%
  select(Ser.No,Fund, Return_1_Yr, Return_3_Yr,Return_5_Yr,Return_Ten_Yr, NAV) %>%
  kable(escape = F) %>%
  kable_styling("hover", full_width = T) %>%
  scroll_box(width = "100%", height = "300px")
Ser.No Fund Return_1_Yr Return_3_Yr Return_5_Yr Return_Ten_Yr NAV
1 Tata Digital India Fund - Direct Plan 40.30 27.15 NA NA Net Assets (Cr).y
2 ICICI Prudential Technology Fund - Direct Plan 51.39 26.09 16.72 NA Net Assets (Cr).y
3 Aditya Birla Sun Life Digital India Fund - Direct Plan 47.09 25.52 17.61 NA Net Assets (Cr).y
4 ICICI Prudential Technology Fund 50.48 25.05 15.79 16.67 Net Assets (Cr).y
5 Tata Digital India Fund - Regular Plan 38.00 25.02 NA NA Net Assets (Cr).y
6 Aditya Birla Sun Life Digital India Fund 45.67 24.32 16.61 13.83 Net Assets (Cr).y
7 SBI Technology Opportunities Fund - Direct Plan 37.09 23.81 14.79 NA Net Assets (Cr).y
8 SBI Technology Opportunities Fund 35.90 22.51 13.76 14.38 Net Assets (Cr).y
9 Nippon India Pharma Fund - Direct Plan 58.29 20.61 10.56 NA Net Assets (Cr).y
10 Nippon India Pharma Fund 56.92 19.57 9.59 14.84 Net Assets (Cr).y
11 Tata India Pharma & HealthCare Fund - Direct Plan 55.36 18.91 NA NA Net Assets (Cr).y
12 Tata India Pharma & HealthCare Fund - Regular Plan 53.01 16.97 NA NA Net Assets (Cr).y
13 UTI Healthcare Fund - Direct Plan 63.60 16.56 8.00 NA Net Assets (Cr).y
14 SBI Tax Advantage Fund - Series III - Direct Plan 29.97 15.87 18.04 NA Net Assets (Cr).y
15 UTI Healthcare Fund - Regular Plan 62.12 15.42 6.97 11.97 Net Assets (Cr).y
top.mf <- aa.mf[, c(1,7,20,22,24,44)]
top.mf <- top.mf[order(top.mf$`1 Yr Ret (%).x`, decreasing = TRUE),]
top.mf$aax <- top.mf$`10 Yr Ret (%)`
top.mf <- top.mf[1:15,]

rownames(top.mf) <- NULL
value.string <- paste("Top 15 MF's with highest 1 Year Return ")
row.ctr <- nrow(top.mf)
paste(colFmt(value.string, "blue"))

[1] “Top 15 MF’s with highest 1 Year Return

top.mf[1:row.ctr,] %>%
  mutate(
    Ser.No = row.names(.),
    Fund = (`Fund Name`),
    Return_1_Yr = color_tile("white", "orange")(`1 Yr Ret (%).x`),
    Return_3_Yr = color_tile("white", "green")(`3 Yr Ret (%)`),
    Return_5_Yr = color_tile("white", "blue")(`5 Yr Ret (%)`),
    Return_Ten_Yr = color_tile("white", "red")(aax),
    NAV = color_tile("white", "purple")('Net Assets (Cr).y')
    
  ) %>%
  select(Ser.No,Fund, Return_1_Yr, Return_3_Yr,Return_5_Yr,Return_Ten_Yr, NAV) %>%
  kable(escape = F) %>%
  kable_styling("hover", full_width = T) %>%
  scroll_box(width = "100%", height = "300px")
Ser.No Fund Return_1_Yr Return_3_Yr Return_5_Yr Return_Ten_Yr NAV
1 UTI Healthcare Fund - Direct Plan 63.60 16.56 8.00 NA Net Assets (Cr).y
2 UTI Healthcare Fund - Regular Plan 62.12 15.42 6.97 11.97 Net Assets (Cr).y
3 Nippon India Pharma Fund - Direct Plan 58.29 20.61 10.56 NA Net Assets (Cr).y
4 SBI Healthcare Opportunities Fund - Direct Plan 58.14 14.06 5.74 NA Net Assets (Cr).y
5 Nippon India Pharma Fund 56.92 19.57 9.59 14.84 Net Assets (Cr).y
6 SBI Healthcare Opportunities Fund 56.39 12.81 4.52 14.53 Net Assets (Cr).y
7 Tata India Pharma & HealthCare Fund - Direct Plan 55.36 18.91 NA NA Net Assets (Cr).y
8 Quant Small Cap Fund - Direct Plan 54.88 7.66 7.70 NA Net Assets (Cr).y
9 Quant Small Cap Fund 54.22 7.23 7.44 7.52 Net Assets (Cr).y
10 Tata India Pharma & HealthCare Fund - Regular Plan 53.01 16.97 NA NA Net Assets (Cr).y
11 ICICI Prudential Technology Fund - Direct Plan 51.39 26.09 16.72 NA Net Assets (Cr).y
12 ICICI Prudential Technology Fund 50.48 25.05 15.79 16.67 Net Assets (Cr).y
13 Aditya Birla Sun Life Digital India Fund - Direct Plan 47.09 25.52 17.61 NA Net Assets (Cr).y
14 Aditya Birla Sun Life Digital India Fund 45.67 24.32 16.61 13.83 Net Assets (Cr).y
15 Tata Digital India Fund - Direct Plan 40.30 27.15 NA NA Net Assets (Cr).y
#print(dfSummary(top.mf[,c(1,29, 27,28,25, 5,14,18)]), max.tbl.height = 300, method = "render", footnote = NA)
knitr::opts_chunk$set(echo = TRUE)
pandoc.header(colFmt("Section-2: Interactive Tables-Debt Funds", 'red'), 1, 'setext')

Section-2: Interactive Tables-Debt Funds

pandoc.header(colFmt("2A: Values Table:- R-Sq, Alpha, Beta, Sharpe Ratio & Exp-Ratio", 'blue'), 1, 'setext')

2A: Values Table:- R-Sq, Alpha, Beta, Sharpe Ratio & Exp-Ratio

disp.df <- vr.df.new[grep("DT-", vr.df.new$Category),c(1,3,4,5,29,27,28,25)]
datatable(disp.df[order(disp.df$Category),], filter = "top", options = list(scrollY = '300px'), rownames = FALSE )
pandoc.header(colFmt("2B: Performance and Ranking Table", 'blue'), 1, 'setext')

2B: Performance and Ranking Table

disp.df <- vr.df.new[grep("DT-", vr.df.new$Category),c(1,3,16,17,18,19,20,21,22,24)]
datatable(disp.df[order(disp.df$`10 Yr Ret (%)`, disp.df$`5 Yr Ret (%)`, decreasing = TRUE),], 
          filter = "top", options = list(scrollY = '300px'), rownames = FALSE )
pandoc.header(colFmt("2C: Turnover and Risks Table", 'blue'), 1, 'setext')

2C: Turnover and Risks Table

disp.df <- vr.df.new[grep("DT-", vr.df.new$Category),c(1,3,4,8,9,23,31,32,33,34)]
datatable(disp.df[order(disp.df$Category),], filter = "top", options = list(scrollY = '300px'), rownames = FALSE )
knitr::opts_chunk$set(echo = TRUE)
pandoc.header(colFmt("Section-3: Interactive Tables-Equity Funds", 'red'), 1, 'setext')

Section-3: Interactive Tables-Equity Funds

pandoc.header(colFmt("3A: Values Table:- R-Sq, Alpha, Beta, Sharpe Ratio & Exp-Ratio", 'blue'), 1, 'setext')

3A: Values Table:- R-Sq, Alpha, Beta, Sharpe Ratio & Exp-Ratio

disp.df <- vr.df.new[grep("EQ-", vr.df.new$Category),c(1,3,4,5,29,27,28,25)]
datatable(disp.df[order(disp.df$Category),], filter = "top", options = list(scrollY = '300px'), rownames = FALSE )
pandoc.header(colFmt("3B: Performance and Ranking Table", 'blue'), 1, 'setext')

3B: Performance and Ranking Table

disp.df <- vr.df.new[grep("EQ-", vr.df.new$Category),c(1,3,16,17,18,19,20,21,22,24)]
datatable(disp.df[order(disp.df$`10 Yr Ret (%)`, disp.df$`5 Yr Ret (%)`, decreasing = TRUE),], 
          filter = "top", options = list(scrollY = '300px'), rownames = FALSE )
pandoc.header(colFmt("3C: Turnover and Risks Table", 'blue'), 1, 'setext')

3C: Turnover and Risks Table

disp.df <- vr.df.new[grep("EQ-", vr.df.new$Category),c(1,3,4,8,9,23,31,32,33,34)]
datatable(disp.df[order(disp.df$Category),], filter = "top", options = list(scrollY = '300px'), rownames = FALSE )
knitr::opts_chunk$set(echo = TRUE)
pandoc.header(colFmt("Section-4: Interactive Tables-Hybrid Funds", 'red'), 1, 'setext')

Section-4: Interactive Tables-Hybrid Funds

pandoc.header(colFmt("4A: Values Table:- R-Sq, Alpha, Beta, Sharpe Ratio & Exp-Ratio", 'blue'), 1, 'setext')

4A: Values Table:- R-Sq, Alpha, Beta, Sharpe Ratio & Exp-Ratio

disp.df <- vr.df.new[grep("HY-", vr.df.new$Category),c(1,3,4,5,29,27,28,25)]
datatable(disp.df[order(disp.df$Category),], filter = "top", options = list(scrollY = '300px'), rownames = FALSE )
pandoc.header(colFmt("4B: Performance and Ranking Table", 'blue'), 1, 'setext')

4B: Performance and Ranking Table

disp.df <- vr.df.new[grep("HY-", vr.df.new$Category),c(1,3,16,17,18,19,20,21,22,24)]
datatable(disp.df[order(disp.df$`10 Yr Ret (%)`, disp.df$`5 Yr Ret (%)`, decreasing = TRUE),], 
          filter = "top", options = list(scrollY = '300px'), rownames = FALSE )
pandoc.header(colFmt("4C: Turnover and Risks Table", 'blue'), 1, 'setext')

4C: Turnover and Risks Table

disp.df <- vr.df.new[grep("HY-", vr.df.new$Category),c(1,3,4,8,9,23,31,32,33,34)]
datatable(disp.df[order(disp.df$Category),], filter = "top", options = list(scrollY = '300px'), rownames = FALSE )