dat <- cbind(
  data.frame(car = row.names(mtcars), stringsAsFactors = FALSE),
  mtcars )

Tables {#tables}

This is famous mtcars dataset:

head(dat, n = 10)

This is famous iris dataset:

head(iris)

This a flextable:

if(require("flextable")){
  ft <- flextable(head(mtcars, n = 10))
  ft <- fontsize(ft, size = 9, part = "all")
  ft <- compose(x = ft, j = "mpg",
    value = as_paragraph(
      value = lollipop(value = mpg, min = 0, max = 30, positivecol = "#DD2233", rangecol = "#DD2233")
      ))
  ft <- compose(x = ft, j = "drat",
    value = as_paragraph(
      value = minibar(value = drat, max = 6, barcol = "#DD3322")
      ))
  ft <- compose(x = ft, j = "qsec",
    value = as_paragraph(
      value = linerange(value = qsec)
      ))
  ft <- set_table_properties(ft, layout = "autofit")
  ft
  }


Try the officedown package in your browser

Any scripts or data that you put into this service are public.

officedown documentation built on Sept. 3, 2023, 1:07 a.m.