huxtable (version 0.2.0)

mutate_.huxtable: Dplyr verbs for huxtable

Description

Huxtable can be used with dplyr verbs select, rename, slice, arrange, mutate and transmute. These will return huxtables. Other verbs like summarize will simply return data frames as normal.

Usage

# S3 method for huxtable
mutate_(.data, ..., .dots)

Arguments

.data
A huxtable.
..., .dots
Arguments passed to mutate.

Details

If mutate creates new columns, and the argument copy_cell_props is missing or TRUE, then cell and column properties will be copied from existing columns to their left, if there are any. Otherwise, they will be the standard defaults. Row and table properties, and properties of cells in existing columns, remain unchanged.

Examples

Run this code
ht <- hux(a = 1:5, b = 1:5, c = 1:5, d = 1:5)
bold(ht)[c(1, 3), ] <- TRUE
bold(ht)[, 1] <- TRUE
ht2 <- dplyr::select(ht, b:c)
ht2
bold(ht2)
ht3 <- dplyr::mutate(ht, x = a + b)
ht3
bold(ht3)
ht4 <- dplyr::mutate(ht, x = a + b, copy_cell_props = FALSE)
bold(ht4)

Run the code above in your browser using DataCamp Workspace