# NOT RUN {
# Create a tibble that contains heights
# of an image in pixels (one column as a
# string, the other as numerical values),
# then, create a gt table; use the
# `text_transform()` function to insert
# a local test image (PNG) image with the
# various sizes
tab_1 <-
dplyr::tibble(
pixels = px(seq(10, 35, 5)),
image = seq(10, 35, 5)
) %>%
gt() %>%
text_transform(
locations = cells_body(vars(image)),
fn = function(x) {
local_image(
filename = test_image(type = "png"),
height = as.numeric(x)
)
}
)
# }
Run the code above in your browser using DataLab