dump_df_mat_to_file: Dump a dataframe/matrix to MS Word file

Description Usage Arguments Value

View source: R/dump_df_mat_to_file.R

Description

This function takes a dataframe or matrix and dumps it out as a table in a MS Word file. The table will be printed in the R Viewer as well. The defaults are such that minimal fussing with the R object is required in order to create the MS Word table. This was designed to streamline the process of moving from completed analysis to output.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
dump_df_mat_to_file(
  out,
  cols = NULL,
  decimals = 2,
  NA.string = NA,
  fontname = "Arial",
  size = 11,
  align = "center",
  table.title = NULL,
  table.footnote = NULL,
  print.dir = NULL,
  file.name = NULL
)

Arguments

decimals

a vector of the number of decimals to round each numeric column to, can also be a scalar if that number applies to all the numbers; default is 2

NA.string

determines how to print out missing (i.e., NA) strings; default is blank

fontname

specify the font to pass to flextable; default is 'Arial'

size

specify the font size to pass to flextable; default is 11.

align

specify the table alignment to pass to flextable; default is 'center'. See ?flextable::align for details

table.title

pass a character vector specifying the table title

table.footnote

pass a character vector specifying a footnote

print.dir

pass a file path for the file to be printed out to; default is the working directory

file.name

pass a name for the file

shell.table

logical, default is FALSE. Specify if all numeric values should be converted to 'x', as in a shell-table for a report

Value

outputs table in a MS Word table and prints table to R Viewer


CJangelo/R2Word documentation built on June 26, 2021, 6:35 a.m.