The first guide to this package can be found here.
You can install from github with devtools
:
library(devtools) devtools::install_github("jalapic/simpletable")
Rownames
The rownames of a dataframe won't automatically be included as the first column. To get them to show you need to do something like this:
library(simpletable)
tablecode(cbind(car=rownames(mtcars), mtcars), tabletype="minimal")
tablecode(cbind(car=rownames(mtcars), mtcars), tabletype="gridtable")
Here's an example using data from my engsoccerdata. I'm using a function in that package called maketable
which converts raw soccer scores into an end of season final league standings table. I've happened to pick the final standings for the 1994/95 season for the top tier of English soccer. I then turn that into a more attractive table with tablecode
from simpletable:
library(engsoccerdata) library(dplyr) engsoccerdata2 %>% filter(Season==1994 & tier==1) %>% maketable() %>% as.data.frame() %>% tablecode(tabletype="another")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.