#somma di due dadi
dado<- c(1:6)
x<-sample(dado,size=2000,replace=TRUE)
y=matrix(x,ncol=2)
z<-apply(y,MARGIN=1,FUN=sum)
freq_assolute<-table(z)
freq_relative<-prop.table(table(z))
par(mfrow=c(1,2))
grf_assolute<-plot(table(z),ylab="Frequenze assolute")
grf_relative<-plot(prop.table(table(z)),ylab="Frequenze relative")
par(mfrow=c(1,2))
cat(grf_assolute,grf_relative)
par(mfrow=c(1,1))