Skip to content

Instantly share code, notes, and snippets.

@CSJCampbell
CSJCampbell / curvefishing_land_drops_eg.R
Created August 23, 2022 00:01
Example of analysing deck opportunities by land drop
# author: Lacerto
# title: use curvefishing package to analyse magic:the gathering deck performance by land drop profile
# packages
# install devtools for devtools::install_github
install.packages("devtools")
library(devtools)
# install curvefishing
install_github("CSJCampbell/curvefishing/curvefishing")
@CSJCampbell
CSJCampbell / survfit.coxph.patch
Created April 30, 2021 23:07
#130 - Survival curves of stratified coxph objects
diff --git a/R/survfit.coxph.R b/R/survfit.coxph.R
index 43b10c4..25872e5 100644
--- a/R/survfit.coxph.R
+++ b/R/survfit.coxph.R
@@ -110,15 +110,6 @@ survfit.coxph <-
}
}
- }
- if (FALSE) {
#### Getting started with sparklyr ####
# ccampbell
# 15-May-2018
# This tutorial will demonstrate that
# a local Spark instance is a useful
# tool for a data scientist working on
# mid-sized datasets.
###########################################################
#
# Introduction to Text Mining
# ccampbell
# 2017-11-09
# Script to learn text mining basics
#
###########################################################
#------------------------------------------------------------------------------#
# Working with scales, guides and themes
# Mango Solutions - EARL Workshop
#------------------------------------------------------------------------------#
library(tidyverse)
library(forcats)
funded <- read_csv("http://bit.ly/UKFundedSports0016")
@CSJCampbell
CSJCampbell / nationalityRating.csv
Last active September 26, 2017 22:15
WTC 2017 Analysis
country Rating
Australia 2445.549203
England 2343.962608
USA 2342.762909
Sweden 2313.943643
Poland 2279.733775
Germany 2263.613631
Canada 2256.044501
Austria 2246.198598
NA 2216.573624
# @title A Whistle-Stop Tour of the Tidyverse
# @author agott <agott@mango-solutions.com>
library(tidyverse)
# tidy manifesto
## Reuse existing data structures
## Compose simple functions with the pipe
women %>% plot
## Embrace functional programming
Sport Sydney Athens Beijing London Rio de Janeiro
Archery n/a £800,000 £2,834,000 £4,408,000 £2,952,237
Athletics £10,600,000 £11,400,000 £26,513,000 £25,148,000 £26,824,206
Badminton n/a** n/a** £8,759,000 £7,434,900 £5,737,524
Basketball n/a n/a £3,694,000 £8,599,000 n/a
Boxing n/a** n/a** £5,005,000 £9,551,400 £13,764,437
Canoeing £4,500,000 £4,700,000 £13,622,000 £16,176,700 £20,043,618
Cycling £5,400,000 £8,600,000 £22,151,000 £26,032,000 £30,267,816
Diving £900,000 £1,400,000 £5,873,000 £6,535,700 £7,467,860
Equestrian £3,000,000 £4,400,000 £11,727,000 £13,395,100 £17,992,600
###########################################################
#
# Battle Reporter and the WITC 2016
# csjcampbell
# 2016-10-22
#
# Copyright 2016 CSJCampbell
# This document may be reproduced in whole or part provided
# that this notice is retained.
###########################################################
#
# Rate My Captain WTC 2015
# csjcampbell
# 2016-10-17
#
# Copyright 2016 CSJCampbell
# This document may be reproduced in whole or part provided
# that this notice is retained.