Setup

knitr::opts_chunk$set(echo = TRUE)
library(dplyr)
library(knitr)
library(pmtables)

dir <- "build"

Tables

tab <- stable(stdata())
longtab <- stable_long(stdata())
sttab <- st_new(stdata())
pttab <- pt_cat_long(pmt_first, span="STUDYf", cols = "SEXf")
brokentab <- tab
brokentab[4] <- ""

Tests

Convert from stable

st_as_image(tab, dir = dir, stem = "convert-stable")

Convert from long stable

st_as_image(longtab, dir = dir, stem = "convert-longtable", ntex = 2)

Convert from pmtable

st_as_image(pttab, dir = dir, stem = "convert-pttab")

Convert from stobject

st_as_image(sttab, dir = dir, stem = "convert-sttab")

Include from png

file <- st_aspng(tab, dir = dir, stem = "include-from-png")
include_graphics(file)

Make the page smaller

st_as_image(tab, dir = dir, stem = "smaller-page", textwidth = 4)

Make display width smaller

st_as_image(tab, dir = dir, stem = "smaller-width", width = 0.5)

Bigger border on the top

st_as_image(tab, dir = dir, stem = "bigger-border", border = "0.2cm 3cm")

Change the font - utopia

st_as_image(tab, dir = dir, stem = "test-utopia", font = "utopia")

Change the font - roboto

st_as_image(tab, dir = dir, stem = "test-roboto", font = "roboto")

Broken pdf

st_as_image(brokentab)

Broken png

st_image_show(st_aspng(brokentab))

Session

date()
sessionInfo()


metrumresearchgroup/pmtables documentation built on Oct. 27, 2024, 5:16 p.m.