Skip to content

Instantly share code, notes, and snippets.

View sjbeckett's full-sized avatar

Stephen Beckett sjbeckett

View GitHub Profile
@sjbeckett
sjbeckett / test.ipynb
Created March 21, 2020 22:54
test notebook
{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"using Interact, Plots"
]
@sjbeckett
sjbeckett / nicd_data_scrape.R
Last active December 13, 2021 19:02
nicd_hospital_surveillance_scrape
library(pdftools)
library(stringr)
library(rvest)
ExamplePDFLink = "https://www.nicd.ac.za/wp-content/uploads/2020/12/NICD-COVID-19-Daily-Sentinel-Hospital-Surveillance-report-National-20201228.pdf"
#Take url pdf file and extract table 2 (stats by province) and the report date
convertPDFToDataFrame<-function(PDFLink){
HospitalData = pdf_text(PDFLink)
JAM =HospitalData[2] #take second table
@sjbeckett
sjbeckett / sir_model.jl
Created April 2, 2024 20:15
SIR model in Julia
function SIRmodel!(du,u,p,t)
S, I, R = u
β, γ = p
du[1] = -β*S*I
du[2] = β*S*I - γ*I
du[3] = γ*I
end
#timespan of between 0 and 100 days.