colors %>%
select(country, starts_with("c")) %>%
mutate_at(vars(-country), funs(cell_spec(., color = .))) %>%
mutate(Flag = gsub(" ", "-", str_to_lower(country)),
Flag = paste0('<img src="../../icon/flag/vsmall/', Flag, '.png" alt="Flag">')) %>%
select(Flag, everything()) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}
flagColors_data %>%
select(country, starts_with("c")) %>%
mutate_at(vars(-country), funs(cell_spec(., color = .))) %>%
mutate(Flag = gsub(" ", "-", str_to_lower(country)),
Flag = paste0('<img src="../../icon/flag/vsmall/', Flag, '.png" alt="Flag">')) %>%
select(Flag, everything()) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}
flagColors("Germany") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#FFCE00 |
![]() |
#FFCE00 | 33 |
#000000 |
![]() |
#000000 | 33 |
#DD0000 |
![]() |
#DD0000 | 32 |
#E84500 |
![]() |
#E84500 | 1 |
#930000 |
![]() |
#930000 | 1 |
flagColors("Italy") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#FFFFFF |
![]() |
#FFFFFF | 33.33 |
#009246 |
![]() |
#009246 | 33.33 |
#CE2B37 |
![]() |
#CE2B37 | 33.33 |
flagColors("France") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#FFFFFF |
![]() |
#FFFFFF | 33.33 |
#002395 |
![]() |
#002395 | 33.33 |
#ED2939 |
![]() |
#ED2939 | 33.33 |
flagColors("Spain") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#C60B1E |
![]() |
#C60B1E | 50.01 |
#FFC400 |
![]() |
#FFC400 | 43.60 |
#975C11 |
![]() |
#975C11 | 1.74 |
#9E2918 |
![]() |
#9E2918 | 1.37 |
#B08F07 |
![]() |
#B08F07 | 1.29 |
#CEB56B |
![]() |
#CEB56B | 0.18 |
flagColors("Bulgaria") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#FFFFFF |
![]() |
#FFFFFF | 33 |
#D62612 |
![]() |
#D62612 | 33 |
#00966E |
![]() |
#00966E | 32 |
#47714F |
![]() |
#47714F | 1 |
#54B99E |
![]() |
#54B99E | 1 |
flagColors("Croatia") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#FF0000 |
![]() |
#FF0000 | 32.58 |
#171796 |
![]() |
#171796 | 32.49 |
#FFFFFF |
![]() |
#FFFFFF | 28.63 |
#FD7071 |
![]() |
#FD7071 | 1.19 |
#B3B3DC |
![]() |
#B3B3DC | 1.02 |
#9C2639 |
![]() |
#9C2639 | 0.13 |
flagColors("Czech Republic") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#FFFFFF |
![]() |
#FFFFFF | 37.33 |
#D7141A |
![]() |
#D7141A | 37.33 |
#11457E |
![]() |
#11457E | 24.67 |
#B0C1D4 |
![]() |
#B0C1D4 | 0.17 |
#6083A9 |
![]() |
#6083A9 | 0.17 |
#95243B |
![]() |
#95243B | 0.17 |
flagColors("Denmark") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#C60C30 |
![]() |
#C60C30 | 76.86 |
#FFFFFF |
![]() |
#FFFFFF | 23.12 |
#D8576F |
![]() |
#D8576F | 0.02 |
flagColors("Hungary") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#436F4D |
![]() |
#436F4D | 33 |
#CD2A3E |
![]() |
#CD2A3E | 33 |
#FFFFFF |
![]() |
#FFFFFF | 32 |
#C1D0C4 |
![]() |
#C1D0C4 | 1 |
#EEB8BF |
![]() |
#EEB8BF | 1 |
flagColors("Poland") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#FFFFFF |
![]() |
#FFFFFF | 50 |
#DC143C |
![]() |
#DC143C | 50 |
flagColors("Romania") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#002B7F |
![]() |
#002B7F | 33.33 |
#CE1126 |
![]() |
#CE1126 | 33.33 |
#FCD116 |
![]() |
#FCD116 | 33.33 |
flagColors("Sweden") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#006AA7 |
![]() |
#006AA7 | 70 |
#FECC00 |
![]() |
#FECC00 | 30 |
flagColors("United Kingdom") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#CF142B |
![]() |
#CF142B | 36.09 |
#FFFFFF |
![]() |
#FFFFFF | 31.36 |
#F3C4CA |
![]() |
#F3C4CA | 1.54 |
#AAB6D4 |
![]() |
#AAB6D4 | 1.48 |
#DB4F60 |
![]() |
#DB4F60 | 1.25 |
#6E82B5 |
![]() |
#6E82B5 | 1.04 |
flagColors("United States") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#B22234 |
![]() |
#B22234 | 37.20 |
#FEFEFE |
![]() |
#FEFEFE | 33.99 |
#3C3B6E |
![]() |
#3C3B6E | 18.11 |
#CA6673 |
![]() |
#CA6673 | 4.40 |
#EDCDD1 |
![]() |
#EDCDD1 | 3.18 |
#DC9AA2 |
![]() |
#DC9AA2 | 1.60 |
flagColors("Switzerland") %>%
mutate(hex_c = cell_spec(hex, background = hex, color = hex)) %>%
select(hex_c, everything()) %>%
print_table_no_escape
hex_c | Flag | hex | percent |
---|---|---|---|
#FF0000 |
![]() |
#FF0000 | 78.48 |
#FFFFFF |
![]() |
#FFFFFF | 19.08 |
#FF6060 |
![]() |
#FF6060 | 2.40 |
#FF9C9C |
![]() |
#FF9C9C | 0.04 |