HTML Tables with xtable Package
library(xtable)
library(plyr)

data(mtcars)

# create a data frame that contains mean mpg values by the number of cylinders
summary_data <- ddply(mtcars, .(cyl), summarise, mean_mpg = mean(mpg))

# rename columns in data frame 
colnames(summary_data) <- c('Cylinders', 'Mean MPG')

# Create in print xtable in html
print(xtable(summary_data, 
             caption="Mean MPG by Cylinders"), 
              "html", include.rownames=FALSE, caption.placement='top',
               html.table.attributes='align="left"')
Mean MPG by Cylinders
Cylinders Mean MPG
4.00 26.66
6.00 19.74
8.00 15.10


HTML Tables with knitr Package
library(knitr)

kable(head(mtcars), digits=2)
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160 110 3.90 2.62 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160 110 3.90 2.88 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.32 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.21 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.44 17.02 0 0 3 2
Valiant 18.1 6 225 105 2.76 3.46 20.22 1 0 3 1


HTML Tables with googleVis Package
suppressMessages(library(googleVis))

cars <- cbind(car = rownames(mtcars), mtcars)

table <- gvisTable(cars, 
              #formats=list(Population="#,###")  
              options=list(page='enable'))

print(table)
TableID26b8281928c3
Data: cars • Chart ID: TableID26b8281928c3googleVis-0.5.4
R version 3.1.0 (2014-04-10) • Google Terms of UseDocumentation and Data Policy