## ----setup, include=FALSE----------------------------------------------------- library(knitr) opts_chunk$set(fig.path='figure/beamer-',fig.align='center',fig.show='hold',size='footnotesize' ) ## ----fig.show='hide',echo=FALSE,label=reg------------------------------------- par ( mfrow=c(2,2) ) data ( attenu ) plot ( attenu$dist, attenu$accel, xlab="Distance", ylab="Acceleration", main="(a)", pch="." ) data ( airquality ) plot ( airquality$Temp, airquality$Ozone, xlab="temperature", ylab="ozone", main="(b)", pch="." ) data ( mtcars ) stripchart ( mtcars$wt ~ mtcars$am, pch=1, xlab="Weight", method="jitter", ylab="Manual Transmission", main="(c)" ) data ( faithful ) plot ( faithful, pch=".", main="(d)" ) ## ----echo=FALSE,fig.show='hide',label=covid----------------------------------- repository="https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/" regional.dataset= "dati-regioni/dpc-covid19-ita-regioni.csv" regional.filename=paste(repository,regional.dataset,sep="") regions=read.csv(regional.filename) plot(regions[regions[,4]=='Lazio',13],main='Lazio, New daily covid19 cases ',xlab='Days from 22-2-2020' ,cex.main=1.7) ## ----echo=FALSE,fig.show='hide',label=covid2---------------------------------- nuovi.tamponi=c(0,diff(regions[regions[,4]=='Lazio',17])) plot(nuovi.tamponi,main='Lazio, daily number of swabs ',xlab='Days from 22-2-2020' ,cex.main=1.7) ## ----echo=FALSE,fig.show='hide',label=covid3---------------------------------- plot(nuovi.tamponi,main='Lazio, daily number of swabs ',xlab='Days from 22-2-2020' ,cex.main=1.7) x=seq(1,length(nuovi.tamponi),by=1) lines ( lowess ( x, nuovi.tamponi ) ,col=4,lwd=3) lines ( supsmu ( x, nuovi.tamponi ), lty=2 ,col=2,lwd=3) ## ----fig.show='hide',label=hotdog--------------------------------------------- hotdogs<-read.table("hotdogs.txt",header=T) stripchart(hotdogs$Calories~hotdogs$Type,pch=1,xlab="Calorie") ## ----fig.show='hide',label=hotdog2-------------------------------------------- par(mfrow=c(3,1)) tipo=levels(hotdogs$Type) for(i in 1:3) { gruppo<-(hotdogs$Type==tipo[i]) plot(density(hotdogs[gruppo,2],bw=20),xlim=c(50,250),main=tipo[i])}