Insert 'gt' Tables into Word Documents

Insert tables created by the 'gt' R package into 'Microsoft Word' documents. This gives users the ability to add to their existing word documents the tables made in 'gt' using the familiar 'officer' package and syntax from the 'officeverse'.


gto

Codecov test coverage R-CMD-check

The goal of gto is to provide the tools to allow users to insert gt tables into officeverse. Right now the only supported output is word.

Installation

You can install the development version of gto like so:

remotes::install_github("GSK-Biostatistics/gto")

Example


#load officer and gt
library(officer)
library(gt)
library(gto)

## create simple gt table
gt_tbl <- gt(head(exibble))

## Create docx and add gt table
doc <- read_docx()
doc <- body_add_gt(doc, value = gt_tbl)

## Save docx
fileout <- tempfile(fileext = ".docx")
print(doc, target = fileout)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("gto")

0.1.2 by Ellis Hughes, 2 years ago


Browse source code at https://github.com/cran/gto


Authors: Ellis Hughes [aut, cre] , GlaxoSmithKline Research & Development Limited [cph, fnd]


Documentation:   PDF Manual  


Apache License (>= 2) license


Imports gt, magrittr, officer, rlang, xml2

Suggests testthat, dplyr, tibble, covr


See at CRAN