marge=function(meanstable){
colmargin=apply(meanstable,MARGIN=1,FUN=mean)
rowmargin=apply(meanstable,MARGIN=2,FUN=mean)
grandmean=mean(colmargin)
return(rbind(cbind(meanstable,colmargin),c(rowmargin,grandmean)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.