knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(Rogctable)

Open the PDF with Adobe Acrobat Reader and then click on the column names!

x = data.frame(`First name` = c("Paul","John","Ever","Werner","Peggy"),
               `Last name` = c("Bauer", "Doe", "Last", "Moshammer", "Sue"),
               `Grade` = c(1,5,4,1,3),
               check.names = FALSE))
cat(ogc_table(x),sep = "\n")
x = data.frame(`First name` = c("Paul","John","Ever","Werner","Peggy"),
               `Last name` = c("Bauer", "Doe", "Last", "Moshammer", "Sue"),
               `Grade` = c(1,5,4,1,3),
               check.names = FALSE)
cat(ogc_table(x),sep = "\n")
d = iris[c(1:3, 51:52,102:105),]
cat(ogc_table(d,),sep = "\n")
d = iris[c(1:3, 51:52,102:105),]
cat(ogc_table(d, striped = TRUE),
    sep = "\n")

You can also hide/show a specific column:

quiz = data.frame(`Country` = c("Angola","Belgium","France", "Honduras","Singapore"),
               `Capital` = c("Luanda", "Brussels", "Paris", "Tegucigalpa", "Singapore"),
               `Calling code` = c("+244", "+32", "+33","+504", "+65"),
               check.names = FALSE)
cat(ogc_hide(quiz, striped = TRUE),
    sep = "\n")
quiz = data.frame(`Country` = c("Angola","Belgium","France", "Honduras","Singapore"),
               `Capital` = c("Luanda", "Brussels", "Paris", "Tegucigalpa", "Singapore"),
               `Calling code` = c("+244", "+32", "+33","+504", "+65"),
               check.names = FALSE)
cat(ogc_hide(quiz, striped = TRUE),
    sep = "\n")

Use the parameter show to hide a column by default:

cat(ogc_hide(quiz, striped = TRUE, show = 2),
    sep = "\n")
cat(ogc_hide(quiz, striped = TRUE,show = 2),
    sep = "\n")


AQLT/Rogctable documentation built on Dec. 17, 2021, 6:43 a.m.