Hi,
I'm trying to use the local_image() helper to enter a .png file into a table.
If I try and create the path to the local image in my dataframe, then point local_image() to that path, I get an error of
"Error in file(con, "rb") : invalid 'description' argument"
Here's a minimum working (well, failing) example:
data <- data.frame(team_id = c(1, 22, 1),
stat = c(3, 4, 5)) %>%
mutate(logo_loc = str_glue('/path/to/image/{team_id}_logo.png'))
data %>%
gt() %>%
text_transform(
locations = cells_body(columns = "logo_loc"),
fn = function(x) {local_image(filename = as.character(x), height = 120)})
Any thoughts or advice?
Thanks a lot in advance.
Hi,
I'm trying to use the local_image() helper to enter a .png file into a table.
If I try and create the path to the local image in my dataframe, then point local_image() to that path, I get an error of
"Error in file(con, "rb") : invalid 'description' argument"Here's a minimum working (well, failing) example:
Any thoughts or advice?
Thanks a lot in advance.