View restim.R
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
# Plot regional or national Rt for COVID-19 based on FHM data, to reproduce the | |
# results published on https://www.folkhalsomyndigheten.se/smittskydd-beredskap/utbrott/aktuella-utbrott/covid-19/statistik-och-analyser/analys-och-prognoser/ | |
# Adapted from: | |
# Churches (2020, Feb. 18). Tim Churches Health Data Science Blog: Analysing COVID-19 (2019-nCoV) outbreak data with R - part 1. Retrieved from https://timchurches.github.io/blog/posts/2020-02-18-analysing-covid-19-2019-ncov-outbreak-data-with-r-part-1/, CC BY-SA | |
library(readxl) | |
library(EpiEstim) | |
# path to latest FHM Excel file | |
secov <- read_excel("data/FHM/FHM_latest.xlsx") | |
secov$Statistikdatum <- as.Date(secov$Statistikdatum) |
View tagged-pres.diff
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
*** default.beamer 2020-02-13 11:50:17.541486784 +0100 | |
--- tagged-pres.beamer 2020-02-13 11:32:29.142235033 +0100 | |
*************** | |
*** 10,15 **** | |
--- 10,20 ---- | |
$endif$ | |
$endif$ | |
% | |
+ \begin{filecontents*}{\jobname.xmpdata} | |
+ \Title{$title$} |
View pdfa2a.diff
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
*** default.context 2019-06-22 08:40:19.015364224 +0200 | |
--- default-pdfa2a.context 2019-06-22 08:43:07.763916183 +0200 | |
*************** | |
*** 27,33 **** | |
% make chapter, section bookmarks visible when opening document | |
\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section] | |
\setupinteractionscreen[option=bookmark] | |
- \setuptagging[state=start] | |
$if(papersize)$ |
View WordToPDFA.psm1
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
function ConvertTo-WordPDFA | |
{ | |
Param( | |
[Parameter(Mandatory=$true,Position=0)][String]$dpath | |
) | |
$word_app = New-Object -ComObject Word.Application | |
$doc = $word_app.Documents.Open($dpath) | |
$dpath_dir = [System.IO.Path]::GetDirectoryName($dpath) | |
$dpath_base = [System.IO.Path]::GetFileNameWithoutExtension($dpath) | |
$pdf_fname = $dpath_base + ".pdf" |
View sedor.jl
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
using DataFrames | |
deaths = readtable(normpath("data", "2017-9-10-4Amod.csv")) | |
ages = DataFrame(age = collect(0:20), | |
agest = [0;0;1;collect(5:5:90)], | |
age2 =[0;1;fill(2,3);fill(3,6);fill(4,4);fill(5,2);fill(6,4)]) | |
ages2 = by(ages[:,[:agest, :age2]], :age2, | |
df -> DataFrame(agest=minimum(df[:agest]))) | |
pop = DataFrame() | |
pop1 = readtable(normpath("data", "mfsv16.csv")) |
View meni.jl
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
using DataFrames, PyPlot | |
m = readtable("meni9815.csv") | |
magg = aggregate(m, :Ålder, sum) | |
bar(magg[:Ålder], magg[:Kvinnor_sum], -2, align="edge", label = "Kvinnor") | |
bar(magg[:Ålder], magg[:Män_sum], 2, align="edge", label = "Män") | |
grid(1) | |
legend() | |
xlabel("Ålder") | |
ylabel("Antal (summa för ålder över år)") | |
title("Sjukhusvårdade meningokockinfektion Sverige 1998\u20132015") |
View allskinsv15.csv
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
age | fall | mall | fskin | mskin | |
---|---|---|---|---|---|
0 | 0.0002006 | 0.0002459 | 0.0 | 0.0 | |
5 | 9.22e-5 | 0.0001006 | 0.0 | 0.0 | |
10 | 0.0001424 | 0.0001568 | 0.0 | 0.0 | |
15 | 0.00022940000000000002 | 0.0002389 | 0.0 | 0.0 | |
20 | 0.0003875 | 0.00036030000000000003 | 9.3e-6 | 0.0 | |
25 | 0.0007676 | 0.0004501 | 9.2e-6 | 0.0 | |
30 | 0.0011704 | 0.0007615 | 1.34e-5 | 0.0 | |
35 | 0.0023091 | 0.0009373000000000001 | 2.02e-5 | 9.7e-6 | |
40 | 0.0032355 | 0.0013991 | 3.74e-5 | 3.0299999999999998e-5 |
View amplt.jl
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
using LifeTable, DataFrames | |
function AmpLt(inframe, sex, rate = "inc") | |
age = inframe[1] | |
pop = inframe[2] | |
acd = inframe[3] | |
cd = inframe[4] | |
cc = inframe[5] | |
if rate == "inc" | |
ncol = cc |
View cervc4290rate2.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 36 columns, instead of 22. in line 2.
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
Year,Pop1,Pop2,Pop3,Pop4,Pop5,Pop6,Pop7,Pop8,Pop9,Pop10,Pop11,Pop12,Pop13,Pop14,Pop15,Pop16,Pop17,Pop18,Pop19,Pop20,Pop21,Pop22,Pop23,Pop24,Pop25,Pop26,Pop36sum,Pop222sum,Pop2325sum,Pop38mean,Pop914mean,Pop1518mean,Pop1920mean,Pop2122mean,List | |
1951,3.268342161613885e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.923816852635629e-05,2.2123893805309735e-05,2.982848620432513e-05,5.200594353640416e-05,8.46091861402095e-05,4.908522980812137e-05,8.060453400503778e-05,6.872852233676975e-05,6.93000693000693e-05,3.5842293906810036e-05,5.46448087431694e-05,0.00010416666666666667,4.464285714285714e-05,,,,0.0,3.260653831977091e-05,4.464285714285714e-05,0.0,2.053274867873255e-05,7.07568680725346e-05,5.2571181603439665e-05,7.940573770491804e-05,07A | |
1952,3.8315247790580604e-05,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,4.42282176028306e-06,0.0,3.637686431429611e-05,4.514672686230248e-05,5.167958656330749e-05,5.966587112171838e-05,0.00010048055919615553,8.91089108910891e-05,7.369614512471656e-05,7.407407407407407e-05,9.70873786407767e-05,6. |
View Masironi70.csv
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
ctryname | country | totfat | satfat | suc | m55mort | f55mort | |
---|---|---|---|---|---|---|---|
Jordan | 3170 | 18.5 | 3.7 | 11 | 49 | 19 | |
El Salvador | 2190 | 19.5 | 5.5 | 51 | 28 | ||
Taiwan | 3070 | 15.3 | 4.8 | 4.2 | 58 | 53 | |
Philippines | 3300 | 9.6 | 3.7 | 5.5 | 89 | 40 | |
Guatemala | 2250 | 15.1 | 4.1 | 115 | 84 | ||
Mexico | 2310 | 24.8 | 7.9 | 122 | 65 | ||
Greece | 4140 | 26.5 | 5.4 | 4.9 | 162 | 61 | |
Japan | 3160 | 14.5 | 3.4 | 7.3 | 165 | 92 | |
Panama | 2350 | 22.6 | 6.8 | 8.7 | 170 | 76 |
NewerOlder