data(mtcars)
qable(mtcars)
qable(mtcars, markup = "markdown")
# by make
make <- sub("^(\\w+)\\s?(.*)$", "\\1", rownames(mtcars))
make <- c(table(make))
# A LaTeX table with a verticle bar between each column
qable(mtcars[sort(rownames(mtcars)), ], rgroup = make) 
# A LaTeX table with no verticle bars between columns
qable(mtcars[sort(rownames(mtcars)), ], rgroup = make, vline = "")
# a markdown table
qable(mtcars[sort(rownames(mtcars)), ], rgroup = make, markup = "markdown")
# define your own column names
qable(mtcars[sort(rownames(mtcars)), ], 
      rgroup = make, 
      cnames = toupper(colnames(mtcars)), 
      markup = "markdown")
# define your own column names and add a title
qable(mtcars[sort(rownames(mtcars)), ], 
      rtitle = "Make & Model",
      rgroup = make, 
      cnames = toupper(colnames(mtcars)), 
      markup = "markdown")
Run the code above in your browser using DataLab