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
viridis_pal <- function(alpha=1) { | |
function(n) { | |
viridis(n, alpha) | |
} | |
} | |
scale_color_viridis <- function(..., alpha=1, discrete=TRUE) { | |
if (discrete) { | |
discrete_scale("colour", "viridis", viridis_pal(alpha), ...) |
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
#' --- | |
#' output: | |
#' html_document: | |
#' keep_md: TRUE | |
#' --- | |
#+ include = FALSE | |
library(dplyr) | |
#' Responses to [my |
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
## Curated stuff: | |
## * MetaCran: http://www.r-pkg.org/ | |
## * List of Packages gathered by Garret G.: https://github.com/rstudio/RStartHere | |
## * List of popular packages https://awesome-r.com/ | |
## * List of DataScience R tutorials https://github.com/ujjwalkarn/DataScienceR | |
## * List of machine elearning tutorials by subject: https://ujjwalkarn.github.io/Machine-Learning-Tutorials/ | |
## Reproducible package management for R: | |
install.packages("devtools") | |
install.packages("tidyverse") |
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
#’ Create a Kaplan-Meier plot using ggplot2 | |
#’ | |
#’ @param sfit a \code{\link[survival]{survfit}} object | |
#’ @param returns logical: if \code{TRUE}, return an ggplot object | |
#’ @param xlabs x-axis label | |
#’ @param ylabs y-axis label | |
#’ @param ystratalabs The strata labels. \code{Default = levels(summary(sfit)$strata)} | |
#’ @param ystrataname The legend name. Default = “Strata” | |
#’ @param timeby numeric: control the granularity along the time-axis | |
#’ @param main plot title |