Skip to content

Flag not displaying for Taiwan in gt table with fmt_flag #1335

@ShaneGore

Description

@ShaneGore

Description

Flag not displaying for Taiwan in gt table with fmt_flag

Reproducible example

Package version: gt 0.9.0.9000
R version: 4.2.1

# Create the data frame

country_data <- data.frame(
  CountryCode = c("US", "CA", "GB", "TW"),
  Country = c("United States", "Canada", "United Kingdom", "Taiwan"),
  Population = c(331002651, 37742154, 67886011, 23816775)
)

# Create the gt table
gt_table <- gt(country_data, rowname_col = "CountryCode")|>
  fmt_flag(columns = CountryCode) |>
  cols_label(
    CountryCode = "",
    Country = " Country",
    Population = "Population"
  )

image

Expected result

The Taiwan flag should have matched to country code and rendered.

Session info

R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/prog/FlexiBLAS/3.0.4-GCC-11.2.0/lib64/libflexiblas.so.3.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:

[1] ggimage_0.3.2 cowplot_1.1.1 webshot_0.5.4 gt_0.9.0.9000
[5] gtExtras_0.4.5 countrycode_1.4.0 readxl_1.4.1 forcats_1.0.0
[9] stringr_1.5.0 dplyr_1.1.2 purrr_1.0.1 readr_2.1.2
[13] tidyr_1.3.0 tibble_3.2.1 ggplot2_3.4.2 tidyverse_1.3.2

loaded via a namespace (and not attached):
[1] httr_1.4.6 sass_0.4.6 jsonlite_1.8.4
[4] modelr_0.1.9 paletteer_1.5.0 assertthat_0.2.1
[7] yulab.utils_0.0.5 googlesheets4_1.0.1 cellranger_1.1.0
[10] yaml_2.3.7 pillar_1.9.0 backports_1.4.1
[13] glue_1.6.2 digest_0.6.31 rvest_1.0.3
[16] colorspace_2.1-0 ggfun_0.0.9 htmltools_0.5.5
[19] pkgconfig_2.0.3 broom_1.0.1 haven_2.5.1
[22] magick_2.7.4 scales_1.2.1 processx_3.7.0
[25] ggplotify_0.1.0 fontawesome_0.5.1 tzdb_0.3.0
[28] googledrive_2.0.0 generics_0.1.3 farver_2.1.1
[31] ellipsis_0.3.2 withr_2.5.0 cli_3.6.1
[34] magrittr_2.0.3 crayon_1.5.1 ps_1.7.1
[37] evaluate_0.21 fs_1.6.2 fansi_1.0.4
[40] xml2_1.3.4 textshaping_0.3.6 tools_4.2.1
[43] hms_1.1.2 gargle_1.2.1 lifecycle_1.0.3
[46] munsell_0.5.0 reprex_2.0.2 callr_3.7.2
[49] compiler_4.2.1 gridGraphics_0.5-1 systemfonts_1.0.4
[52] rlang_1.1.1 grid_4.2.1 rstudioapi_0.14
[55] labeling_0.4.2 rmarkdown_2.21 gtable_0.3.3
[58] DBI_1.1.3 curl_5.0.0 rematch2_2.1.2
[61] R6_2.5.1 lubridate_1.8.0 knitr_1.43
[64] fastmap_1.1.1 utf8_1.2.3 ragg_1.2.2
[67] stringi_1.7.12 Rcpp_1.0.10 vctrs_0.6.2
[70] dbplyr_2.2.1 tidyselect_1.2.0 xfun_0.39

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions