This file contains 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
# load library | |
library(tidyverse) | |
# Function to create probability distribution of survival data (PFS) | |
prob_dist <- function(surv, lcl, ucl, ci = 0.95, arm) { | |
lci <- log(-log(lcl)) | |
uci <- log(-log(ucl)) | |
lsurv <- log(-log(surv)) |
This file contains 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
library(shiny) | |
shinyServer(function(input, output, session) { | |
observe({ | |
input$calc | |
isolate({ | |
creat_cat <- input$creat_cat | |
urea <- as.numeric(input$urea) | |
bil_cat <- input$bil |
This file contains 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
#' Make a new column in dataframe with one of the specified values based on given criteria | |
#' | |
#' @description This function is to be run from within \code{mutate, transmute} functions in \code{dplyr} and it makes a new column within the dataframe based on formula based expressions with LHS representing the value to be put in case expression on RHS is satisfied. Rows with no matching expressions will be filled up by the character given by argument \code{escape}. The names appearing in expression will be populated with the values from variables within the parent dataframe, and if not available, will be populated with the values from the calling environment (usually the global environment). | |
#' | |
#' @param ... expressions in form of two sided formula of the form \code{"name_of_choice" ~ expression}. The expressions will be evaluated from left to right and the values in the rows will be modified accordingly. | |
#' @param escape character showing the value to be filled if none of the expressions satisfy (defaults to N |