I am playing around with the package gt and am trying to run the code from the example here
I am running into trouble with the num column. If i quote it, it seems to be ok in the first section but then i run into problems in the second call where quoting wont fix it (columns = num)
# Use `exibble` to create a gt table;
# add styles that are to be applied
# to data cells that satisfy a
# condition (using `tab_style()`)
library(gt)
#> Warning: package 'gt' was built under R version 4.0.5
exibble %>%
dplyr::select(num, currency) %>%
gt() %>%
fmt_number(
columns = c(num, currency),
decimals = 1
) %>%
tab_style(
style = list(
cell_fill(color = "lightcyan"),
cell_text(weight = "bold")
),
locations = cells_body(
columns = num,
rows = num >= 5000
)
) %>%
tab_style(
style = list(
cell_fill(color = "#F9E3D6"),
cell_text(style = "italic")
),
locations = cells_body(
columns = currency,
rows = currency < 100
)
)
#> Error: object 'num' not found