Skip to content

Commit 731b8b1

Browse files
authored
Merge pull request #1645 from rstudio/add-fmt-country
Add the `fmt_country()` function; update `fmt_flag()`
2 parents 404e39f + 5d61b64 commit 731b8b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1163
-64
lines changed

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export(fmt_auto)
107107
export(fmt_bins)
108108
export(fmt_bytes)
109109
export(fmt_chem)
110+
export(fmt_country)
110111
export(fmt_currency)
111112
export(fmt_date)
112113
export(fmt_datetime)

R/data_color.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@
678678
#'
679679
#' @family data formatting functions
680680
#' @section Function ID:
681-
#' 3-33
681+
#' 3-34
682682
#'
683683
#' @section Function Introduced:
684684
#' `v0.2.0.5` (March 31, 2020)

R/format_data.R

+478-29
Large diffs are not rendered by default.

R/substitution.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
#'
132132
#' @family data formatting functions
133133
#' @section Function ID:
134-
#' 3-28
134+
#' 3-29
135135
#'
136136
#' @section Function Introduced:
137137
#' `v0.6.0` (May 24, 2022)
@@ -336,7 +336,7 @@ fmt_missing <- function(
336336
#'
337337
#' @family data formatting functions
338338
#' @section Function ID:
339-
#' 3-29
339+
#' 3-30
340340
#'
341341
#' @section Function Introduced:
342342
#' `v0.6.0` (May 24, 2022)
@@ -546,7 +546,7 @@ sub_zero <- function(
546546
#'
547547
#' @family data formatting functions
548548
#' @section Function ID:
549-
#' 3-30
549+
#' 3-31
550550
#'
551551
#' @section Function Introduced:
552552
#' `v0.6.0` (May 24, 2022)
@@ -822,7 +822,7 @@ sub_small_vals <- function(
822822
#'
823823
#' @family data formatting functions
824824
#' @section Function ID:
825-
#' 3-31
825+
#' 3-32
826826
#'
827827
#' @section Function Introduced:
828828
#' `v0.6.0` (May 24, 2022)
@@ -1127,7 +1127,7 @@ check_sub_fn_sign <- function(sign) {
11271127
#'
11281128
#' @family data formatting functions
11291129
#' @section Function ID:
1130-
#' 3-32
1130+
#' 3-33
11311131
#'
11321132
#' @section Function Introduced:
11331133
#' `v0.8.0` (November 16, 2022)

R/sysdata.rda

268 KB
Binary file not shown.

data-raw/X12-country_names.R

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
library(tidyverse)
2+
3+
country_names <-
4+
readr::read_csv(
5+
file = "data-raw/country_names.csv",
6+
col_types = cols(.default = col_character()),
7+
na = ""
8+
)

data-raw/country_names.csv

+243
Large diffs are not rendered by default.

data-raw/zz_process_datasets_ext.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ source("data-raw/X07-fractions.R")
1010
source("data-raw/X08-durations.R")
1111
source("data-raw/X09-styles_colors_params.R")
1212
source("data-raw/X10-spelled_num.R")
13+
source("data-raw/X11-flags.R")
14+
source("data-raw/X12-country_names.R")
1315

1416
# Create internal datasets (`sysdata.rda`)
1517
usethis::use_data(
1618
currencies, currency_symbols, locales, default_locales,
1719
palettes_strips, google_font_tbl, google_styles_tbl, google_axes_tbl,
1820
css_colors, fractions, durations, styles_colors_params,
19-
spelled_num, flag_tbl,
21+
spelled_num, flag_tbl, country_names,
2022
internal = TRUE, overwrite = TRUE
2123
)

images/man_fmt_country_1.png

148 KB
Loading

images/man_fmt_country_2.png

193 KB
Loading

images/man_fmt_flag_1.png

-26.8 KB
Loading

images/man_fmt_flag_2.png

17.8 KB
Loading

images/man_fmt_flag_3.png

-42.2 KB
Loading

man/data_color.Rd

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fmt.Rd

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fmt_auto.Rd

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fmt_bins.Rd

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fmt_bytes.Rd

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fmt_chem.Rd

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)