Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# go to https://github.com/FortAwesome/Font-Awesome/tree/master/webfonts | |
# and install fa-solid-900.ttf, fa-regular-400.ttf and fa-brands-400.ttf | |
# then run extrafont::font_import() | |
library(tidyverse) | |
library(ggplot2) | |
library(waffle) | |
extrafont::loadfonts() | |
# From LEAP supplemental appendix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_cindex <- function( | |
predictions = NULL, | |
test_truth = NULL | |
){ | |
start_time <- Sys.time() | |
# Prep data | |
predictions_names <- c("patientid","prediction" ) | |
if(!identical(predictions_names,names(predictions))) stop(paste( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
score_auc <- function( | |
predictions, | |
truth | |
){ | |
if (!"patientid" %in% names(predictions)) stop("patientid missing from predictions") | |
if (!"prediction" %in% names(predictions)) stop("prediction missing from predictions") | |
if (!"patientid" %in% names(truth)) stop("patientid missing from truth") | |
if (!"has_long_covid_diag" %in% names(truth)) stop("has_long_covid_diag missing from truth") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
score_cindex <- function( | |
zip_path, # zip file path | |
truth # in memory R object | |
){ | |
library("pec") # pec functions don't work without the lib loaded :( | |
files_present <- zip::zip_list(zip_path)$filename | |
# Check files present |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
geom_glowing_area <- function( | |
alpha = 1, | |
size = 1.5, | |
glow_alpha = 0.05, | |
layers = 10, | |
glow_size = .65){ | |
geoms <- list(ggplot2::geom_area(alpha = .5, position = "identity",color = "#08f7fe")) | |
for(i in (layers+1):1){ |
OlderNewer