Package docxtools. July 6, 2018

Similar documents
Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package messaging. May 27, 2018

Package canvasxpress

Package knitrprogressbar

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package validara. October 19, 2017

Package fastdummies. January 8, 2018

Package postal. July 27, 2018

Package qualmap. R topics documented: September 12, Type Package

Package WordR. September 7, 2017

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package bisect. April 16, 2018

Package spelling. December 18, 2017

Package robotstxt. November 12, 2017

Package jpmesh. December 4, 2017

Package spark. July 21, 2017

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package facerec. May 14, 2018

Package dkanr. July 12, 2018

Package statsdk. September 30, 2017

Package rsppfp. November 20, 2018

Package datapasta. January 24, 2018

Package comparedf. February 11, 2019

Package tidylpa. March 28, 2018

Package calpassapi. August 25, 2018

Package oec. R topics documented: May 11, Type Package

Package BiocStyle. January 26, 2018

Package kdtools. April 26, 2018

Package readxl. April 18, 2017

Package vinereg. August 10, 2018

Package slickr. March 6, 2018

Package gtrendsr. October 19, 2017

Package ECctmc. May 1, 2018

Package dbx. July 5, 2018

Package keyholder. May 19, 2018

Package ezknitr. September 16, 2016

Package meme. December 6, 2017

Package liftr. R topics documented: May 14, Type Package

Package meme. November 2, 2017

Package BiocStyle. December 9, 2018

Package gtrendsr. August 4, 2018

Package humanize. R topics documented: April 4, Version Title Create Values for Human Consumption

Package barcoder. October 26, 2018

Package anomalize. April 17, 2018

Package radix. September 17, 2018

Package states. May 4, 2018

Package ggmosaic. February 9, 2017

Package crossword.r. January 19, 2018

Package vip. June 15, 2018

Package widyr. August 14, 2017

Package NFP. November 21, 2016

Package resumer. R topics documented: August 29, 2016

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package htmlwidgets. July 10, 2017

Package modules. July 22, 2017

Package nngeo. September 29, 2018

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

Package pmatch. October 19, 2018

Package splithalf. March 17, 2018

Package TrafficBDE. March 1, 2018

Package semver. January 6, 2017

Package edfreader. R topics documented: May 21, 2017

Package githubinstall

Package omu. August 2, 2018

Package postgistools

Package memery. February 13, 2018

Package guardianapi. February 3, 2019

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package SEMrushR. November 3, 2018

Package cli. November 5, 2017

Package embed. November 19, 2018

Package revealjs. R topics documented: March 13, Type Package

Package wrswor. R topics documented: February 2, Type Package

Package textrecipes. December 18, 2018

Package essurvey. August 23, 2018

Package jstree. October 24, 2017

Package climber. R topics documented:

Package ezsummary. August 29, 2016

Package fingertipsr. May 25, Type Package Version Title Fingertips Data for Public Health

Package glue. March 12, 2019

Package tidytransit. March 4, 2019

Package opencage. January 16, 2018

Package internetarchive

Package datasets.load

Package knitrbootstrap

Package goodpractice

Package fastqcr. April 11, 2017

Package cancensus. February 4, 2018

Package queuecomputer

Package htmlwidgets. February 25, 2016

Package styler. December 11, Title Non-Invasive Pretty Printing of R Code Version 1.0.0

Package fitbitscraper

Package arphit. March 28, 2019

Package svalues. July 15, 2018

Package balance. October 12, 2018

Package available. November 17, 2017

Package lucid. August 24, 2018

Package texpreview. August 15, 2018

Package sfdct. August 29, 2017

Transcription:

Title Tools for R Markdown to Docx Documents Version 0.2.0 Language en-us Package docxtools July 6, 2018 A set of helper functions for using R Markdown to create documents in docx format, especially documents for use in a classroom or workshop setting. Depends R (>= 3.1.2) License MIT + file LICENSE Encoding UTF-8 LazyData TRUE RoxygenNote 6.0.1 Imports dplyr, ggplot2, lubridate, purrr, rlang, stringr, tidyr Suggests covr, knitr, rmarkdown, rprojroot, testthat VignetteBuilder knitr URL https://cran.r-project.org/package=docxtools, https://graphdr.github.io/docxtools BugReports https://github.com/graphdr/docxtools/issues NeedsCompilation no Author Richard Layton [aut, cre] Maintainer Richard Layton <graphdoctor@gmail.com> Repository CRAN Date/Publication 2018-07-06 07:00:03 UTC R topics documented: density............................................ 2 docxtools.......................................... 2 format_engr......................................... 3 put_axes........................................... 4 put_gap........................................... 5 1

2 docxtools Index 7 density Ideal gas sample data frame Format Air density at room temperature. A data frame to illustrate features of the format_engr() and align_pander() functions. density A data frame with columns: date A date variable. trial A character variable. T_K Numeric air temperature in Kelvin. p_pa Numeric air pressure in Pascals. R Numeric gas constant in J/(kg K) density Numeric air density in kg/m^3 docxtools docxtools: R Markdown to docx helper functions. The docxtools package provides a set of helper functions for using R Markdown to create documents in docx format, especially documents for use in a classroom or workshop setting. The package provides two categories of functions: one for formatting numbers and tables; and one for placing specific objects in a docx output document. Number and table formatting format_engr() Format numerical variables in engineering notation. Insert objects into docx documents put_axes() Insert a two-dimensional coordinate axes in a document. put_gap() Insert a gap or whitespace in a document.

format_engr 3 format_engr Format numerical variables in engineering notation. Converts numeric variables in a data frame into character variables formatted in engineering notation. The formatted character variables are delimited with $...$ for rendering as inline math. format_engr(x, sigdig = NULL, ambig_0_adj = FALSE) Arguments x sigdig ambig_0_adj A data frame with numeric variables to be formatted. An optional vector of significant digits. An optional logical to adjust the format to remove ambiguous trailing zeros. If TRUE, the decimal point is moved three places to the left. Default is FALSE. Engineering notation is a subset of scientific notation: the exponent of ten must be divisible by three. Powers of ten are written with a product symbol (the LaTeX \times symbol), not computer E-notation. The numerical output strings are bounded by $...$ for rendering in math mode. The output format is "coefficient x 10^exponent" except for exponents equal to 0, 1, or 2. In these cases, the output format is floating-point. The input argument is a data frame with at least one numeric variable. Only double variables (not integers and not dates) are formatted in powers of ten. The function distinguishes between integers that represent factors and those that represent numerical integers. Numerical integers are returned as characters in math mode. Factors and other nonnumeric variables are returned unaffected. Each double variable (except dates) can be assigned its own number of significant digits. The default is 4. If sigdig is a single value, it is used for all variables; if a vector, it must have the same number of elements as there are double variables in the data frame. Setting sigdig = 0 returns the double variables as characters but unaltered. For numbers with no decimal point, trailing zeros can be ambiguous. Such numbers can be optionally reported with the decimal moved an additional three places to the left. To learn more about docxtools, start with the vignettes: browsevignettes(package = "docxtools"). Value A data frame with numeric variables converted to formatted strings bounded by "$...$".

4 put_axes Examples # Factors unaffected; ambiguous trailing zeros. data("co2") x <- head(co2, n = 5L) format_engr(x) format_engr(x, sigdig = c(0, 3)) format_engr(x, sigdig = c(3, 3), ambig_0_adj = TRUE) # Ordered factor unaffected; ambiguous trailing zeros. data("dnase") x <- tail(dnase, n = 5L) format_engr(x) format_engr(x, sigdig = c(6, 3)) format_engr(x, sigdig = c(6, 3), ambig_0_adj = TRUE) # Integers returned unchanged but delimited; NA unchanged. data("airquality") x <- head(airquality, n = 6L) format_engr(x, sigdig = 3) put_axes Insert a two-dimensional coordinate axes in a document. Creates an empty, 2-dimensional, coordinate axes using ggplot2: no scales, no tick marks, no axis labels. put_axes(quadrant = NULL, col = NULL, size = NULL) Arguments quadrant col : The quadrant to plot, 1, 2, 3, 4, or 0 for all four. Default is the first quadrant. : Line color, default is "gray60". size : Line width, default is 0.5. The size of the figure is determined when printed, e.g., using knitr in an R Markdown script, the figure height in inches is set with the fig.height code chunk option. Value The empty axes.

put_gap 5 Examples put_axes() put_axes(quadrant = 0) put_axes(col = "red") put_axes(size = 1) ## Not run: # In an R Markdown script {r fig.height = 3.2} put_axes() ## End(Not run) put_gap Insert a gap or whitespace in a document. Creates white space in a document by creating an empty plot in ggplot2. Border and fill can be specified to create a box. The defaults are transparent. put_gap(col = NULL, fill = NULL) Arguments col fill Border color, default is "transparent" Fill color, default is "transparent" Allows the author of Rmd to docx documents to insert a vertical white space of specified height, particularly useful in creating documents that users are expected to write in, such as workshop or student lab materials. The dimensions of the gap are determined when it is printed, e.g., using knitr in an R Markdown script, the box height in inches is set with the fig.height code chunk option. Value Prints the box to the output document.

6 put_gap Examples put_gap() put_gap(col = "gray") put_gap(col = "black", fill = "gray") ## Not run: # In an R Markdown script {r fig.height = 0.75} put_gap() ## End(Not run)

Index Topic datasets density, 2 density, 2 docxtools, 2 docxtools-package (docxtools), 2 format_engr, 3 put_axes, 4 put_gap, 5 7