Add a column to a gt
Arguments
- tab
A
gttable with classgt_tbl- .col
column name
- .val
value to add
- ...
additional arguments to pass to dplyr::add_row
Value
A gt::gt
Examples
rict(wv) |> gt_add_column(r, 3)
#> Warning: There was 1 warning in `dplyr::summarize()`.
#> ℹ In argument: `dplyr::across(where(is.numeric), sum, na.rm = TRUE)`.
#> ℹ In group 1: `district = 1`.
#> Caused by warning:
#> ! The `...` argument of `across()` is deprecated as of dplyr 1.1.0.
#> Supply arguments directly to `.fns` through an anonymous function instead.
#>
#> # Previously
#> across(a:b, mean, na.rm = TRUE)
#>
#> # Now
#> across(a:b, \(x) mean(x, na.rm = TRUE))
#> ℹ The deprecated feature was likely used in the redist package.
#> Please report the issue at <https://github.com/alarm-redist/redist/issues>.
district
pop
pop_white
pop_black
pop_hisp
pop_aian
pop_asian
pop_nhpi
pop_other
pop_two
vap
vap_white
vap_black
vap_hisp
vap_aian
vap_asian
vap_nhpi
vap_other
vap_two
cd_2010
cd_2020
pre_20_rep_tru
pre_20_dem_bid
ndv
adv_20
nrv
arv_20
sample_1
sample_2
sample_3
sample_4
sample_5
sample_6
sample_7
sample_8
sample_9
sample_10
sample_11
sample_12
state
r
