Last active
April 11, 2022 12:47
-
-
Save timmc/7081c40c3a504b9c0138988b8ce62a4b to your computer and use it in GitHub Desktop.
Revisions
-
timmc revised this gist
Apr 11, 2022 . No changes.There are no files selected for viewing
-
timmc revised this gist
Feb 27, 2022 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ xwindow = as.Date(c('2020-01-01', '2022-03-01')) # Log y axis png("${png_path_prefix}.log.png", height=800, width=1200, units='px') plot( d.Suffolk\$timestamp, d.Suffolk\$effective_concentration_rolling_average, type='l', log='y', xlim=xwindow, @@ -30,10 +30,10 @@ dev.off() # Linear y axis png("${png_path_prefix}.lin.png", height=800, width=1200, units='px') plot( d.Suffolk\$timestamp, d.Suffolk\$effective_concentration_rolling_average, type='l', xlim=xwindow, ylim=c(0, max(d.Suffolk\$effective_concentration_rolling_average) * 1.1), ) abline(h=0) # draw y=0 line since origin does not start at 0 dev.off() -
timmc revised this gist
Feb 18, 2022 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -40,4 +40,8 @@ dev.off() EOF ;; *) >&2 echo "Usage: $0 <fetch|plot>" exit 1 ;; esac -
timmc revised this gist
Feb 18, 2022 . 1 changed file with 13 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,42 +2,42 @@ set -eu -o pipefail data_path="/home/timmc/warehouse/biobot-data.csv" png_path_prefix="/home/timmc/warehouse/biobot-data.Suffolk" case "$1" in fetch) curl -sS https://raw.githubusercontent.com/biobotanalytics/covid19-wastewater-data/master/wastewater_by_county.csv > "$data_path" ;; plot) Rscript - <<EOF d = read.csv("$data_path", header=T, sep=',') d.Suffolk=subset(d, d\$name=='Suffolk County, MA') d.Suffolk\$timestamp=as.Date(d.Suffolk\$sampling_week) xwindow = as.Date(c('2020-01-01', '2022-03-01')) # Log y axis png("${png_path_prefix}.log.png", height=800, width=1200, units='px') plot( d.Suffolk\$timestamp, d.Suffolk\$normalized_concentration_rolling_average, type='l', log='y', xlim=xwindow, ) dev.off() # Linear y axis png("${png_path_prefix}.lin.png", height=800, width=1200, units='px') plot( d.Suffolk\$timestamp, d.Suffolk\$normalized_concentration_rolling_average, type='l', xlim=xwindow, ylim=c(0, max(d.Suffolk\$normalized_concentration_rolling_average) * 1.1), ) abline(h=0) # draw y=0 line since origin does not start at 0 dev.off() EOF ;; esac -
timmc revised this gist
Feb 13, 2022 . 1 changed file with 16 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -16,12 +16,27 @@ d = read.csv("$data_path", header=T, sep=',') d.Suffolk=subset(d, d\$name=='Suffolk County, MA') d.Suffolk\$timestamp=as.Date(d.Suffolk\$sampling_week) xwindow = as.Date(c('2020-01-01', '2022-03-01')) png("$png_path", height=800, width=1200, units='px') # Log y axis plot( d.Suffolk\$timestamp, d.Suffolk\$effective_concentration_rolling_average, type='l', log='y', xlim=xwindow, ) # Linear y axis # plot( # d.Suffolk\$timestamp, d.Suffolk\$effective_concentration_rolling_average, # type='l', # xlim=xwindow, # ylim=c(0, max(d.Suffolk\$effective_concentration_rolling_average) * 1.1), # ) # abline(h=0) # draw y=0 line since origin does not start at 0 dev.off() EOF ;; -
timmc created this gist
Feb 13, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ #!/usr/bin/env bash set -eu -o pipefail data_path="/home/timmc/warehouse/biobot-data.csv" png_path="/home/timmc/warehouse/biobot-data.Suffolk.png" case "$1" in fetch) curl -sS https://raw.githubusercontent.com/biobotanalytics/covid19-wastewater-data/master/wastewater_by_county.csv > "$data_path" ;; plot) echo "pending" Rscript - <<EOF d = read.csv("$data_path", header=T, sep=',') d.Suffolk=subset(d, d\$name=='Suffolk County, MA') d.Suffolk\$timestamp=as.Date(d.Suffolk\$sampling_week) png("$png_path", height=800, width=1200, units='px') plot( d.Suffolk\$timestamp, d.Suffolk\$effective_concentration_rolling_average, type='l', log='y', xlim=as.Date(c('2020-01-01', '2022-03-01')) ) dev.off() EOF ;; esac