From 9084506abdd51eb394631c198df397c4e503e9dc Mon Sep 17 00:00:00 2001 From: Greg Date: Fri, 4 Sep 2020 12:31:33 -0400 Subject: [PATCH] Tweak code to show most recent two week data in bottom charts. --- rcode.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rcode.go b/rcode.go index cb92cbe..bc1dbc4 100644 --- a/rcode.go +++ b/rcode.go @@ -30,10 +30,10 @@ p2 <- ggplot(totals, aes(x=date, y=value, group=name, color=name))+geom_line(col pr1 <- ggplot(qrate, aes(x=date, y=value)) + geom_line(color='black',alpha=1/3)+geom_smooth(method='gam',formula=y~s(x, bs="cs"),se=FALSE)+scale_y_continuous(labels = scales::percent, position='right')+labs(y='Positive Rate')+coord_cartesian(ylim=c(0,0.04))+ggtitle('Queens')+theme(plot.title=element_text(hjust = 0.5)) pr2 <- ggplot(trate, aes(x=date, y=value)) + geom_line(color='black',alpha=1/3)+geom_smooth(method='gam',formula=y~s(x, bs="cs"),se=FALSE)+scale_y_continuous(labels = scales::percent, position='right')+labs(y='Positive Rate')+coord_cartesian(ylim=c(0,0.04))+ggtitle('New York')+theme(plot.title=element_text(hjust = 0.5)) -queens <- tail(queens,n=16) -totals <- tail(totals,n=16) -qrate <- tail(qrate,n=8) -trate <- tail(trate,n=8) +queens <- tail(queens,n=32) +totals <- tail(totals,n=32) +qrate <- tail(qrate,n=16) +trate <- tail(trate,n=16) p3 <- ggplot(queens, aes(x=date, y=value, color=name))+geom_line()+scale_y_log10(n.breaks=12, position='right')+labs(y='',color='')+ggtitle('Queens')+theme(plot.title=element_text(hjust = 0.5))+theme(legend.position='bottom') p4 <- ggplot(totals, aes(x=date, y=value, color=name))+geom_line()+scale_y_log10(n.breaks=12, position='right')+labs(y='')+labs(color='')+ggtitle('New York')+theme(plot.title=element_text(hjust = 0.5))+theme(legend.position='bottom')