#' @export
calculate_kda <- function(kills, deaths, assists){
if(deaths == 0){
res <- kills + assists
} else {
res <- round((kills + assists)/deaths, 2)
}
res
}
#' @export
calculate_kp <- function(kills, assists, teamkills){
if(teamkills == 0){
res <- 0
} else {
res <- round(100*(kills + assists)/teamkills, 2)
}
res
}
#' @export
calculate_ks <- function(kills, teamkills){
if(teamkills == 0){
res <- 0
} else {
res <- round(100*kills/teamkills, 2)
}
res
}
#' @export
calculate_ds <- function(deaths, teamdeaths){
if(teamdeaths == 0){
res <- 0
} else {
res <- round(100*deaths/teamdeaths, 2)
}
res
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.