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(dplyr) | |
library(tidyr) | |
choose_partner <- function(People){ | |
Males <- filter(People, gender == "M") | |
Females <- filter(People, gender == "F") | |
if (nrow(Males) <= nrow(Females)){ | |
Males$partner_id <- sample(Females$id, nrow(Males)) | |
People <- full_join(Males, Females, |
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
#* You'll have to source in the function code from the gist | |
#* https://gist.github.com/nutterb/004ade595ec6932a0c29 | |
library(ggplot2) | |
install.packages("KMsurv") | |
data(kidney, package="KMsurv") | |
fit <- survfit(Surv(time, delta) ~ type, data=kidney) | |
ggSurvGraph(fit) | |
ggSurvGraph(fit, conf.bar=FALSE) |
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
#* More examples at https://gist.github.com/nutterb/fb19644cc18c4e64d12a | |
#' @name ggSurvGraph | |
#' @export ggSurvGraph | |
#' @import ggplot2 | |
#' @importFrom grid unit | |
#' @importFrom gridExtra grid.arrange | |
#' @importFrom plyr arrange | |
#' @importFrom plyr ddply | |
#' @importFrom reshape2 melt | |
#' @importFrom zoo na.locf |
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
#### Intended for use with the `redcapAPI` package | |
#' @name missingSummary | |
#' @aliases missingSummary.redcapApiConnection | |
#' @aliases missingSummary.redcapDbConneciton | |
#' @aliases missingSummary_offline | |
#' @export missingSummary | |
#' @export missingSummary.redcapApiConnection | |
#' @export missingSummary.redcapDbConnection | |
#' @export missingSummary_offline | |
#' |
NewerOlder