Skip to content

Instantly share code, notes, and snippets.

Welcome to the Spooky Ride. Expected duration: one hour forty‑five minutes to
three hours, assuming you are not devoured, disoriented, or otherwise erased by
the wildlife. Self‑supported means self‑doomed; there are no aid stations, no
safety sweeps, and no one to hear the chain snap before the gators take an
interest. It is untimed, because clocks have no meaning once you’re swallowed
by the dark. Ride for “fun” if you must call it that. Bring a buddy so someone
can testify later which came first—the crash or the laughter that didn’t sound
quite human.
By participating in this ride, you acknowledge that it is ill-advised, poorly
@MarcusWalz
MarcusWalz / tidy_survfit.R
Last active July 29, 2016 16:58
Survival Plot with ggplot
require(ggplot2)
require(dplyR)
# Convert Survfit object to tidy data frame. survival = TRUE means at x = 0 y = 1 (descending upon event)
# and FALSE means x = 0 y = 0 (ascending)
tidy_km = function( survfit, strata_names = NULL, survival = FALSE) {
#
tidy_single_strata = function ( strata ) {
print(strata$surv)
data_frame(
@MarcusWalz
MarcusWalz / Probability of Entry
Last active November 18, 2015 13:12
Western States 100 Lottery Simulator
entrants tickets expected_winners prob
1 1981 1981 64.98780 0.03280555
2 890 1780 57.54135 0.06465320
3 390 1560 48.80195 0.12513321
4 189 1512 44.29210 0.23434974
5 79 1264 32.71075 0.41406013
6 33 1056 21.66605 0.65654697
sums 3562 9153 270.00000 1.52754879