Skip to content

Commit fb6ca53

Browse files
authored
Merge pull request #30 from rempsyc/document_data
Properly document lflags :D
2 parents 0f6e65c + 9f77b0d commit fb6ca53

File tree

6 files changed

+20
-17
lines changed

6 files changed

+20
-17
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: ggflags
22
Type: Package
3-
Version: 0.0.3
3+
Version: 0.0.4
44
Title: Plot flags of the world in ggplot2
55
Authors@R: c(
66
person("Baptiste", "Auguie",

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# ggflags 0.0.4
2+
3+
- Some more internal rejiggering to ensure that you can use ggflags without explicitly loading the package
4+
- If you're not loading the package and need to use it to plot things, prefix the package functions with `ggflags::` (eg. `ggflags::geom_flag`).
5+
- If you need to access the internal flag list, either load it into the global environment as `lflags` using `data(lflags)` or access it prefixed with `ggflags::lflags`
6+
17
# ggflags 0.0.3
28

39
- Adds Rémi Thériault as an author and contributor!

R/geom_flag.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ makeContent.flag <- function(x) {
6767
seq_along(x$country),
6868
function(ii) {
6969
grImport2::pictureGrob(
70-
picture = .flaglist[[x$country[[ii]]]],
70+
picture = ggflags::lflags[[x$country[[ii]]]],
7171
x = x$x[ii], y = x$y[ii],
7272
width = x$size[ii] * grid::unit(1, "mm"),
7373
height = x$size[ii] * grid::unit(1, "mm"),
@@ -77,6 +77,3 @@ makeContent.flag <- function(x) {
7777
)
7878
grid::setChildren(x, do.call(grid::gList, flag_pics))
7979
}
80-
81-
#' @noRd
82-
utils::globalVariables(c(".flaglist"))

R/lflags.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#' List of country flags
22
#'
33
#' @docType data
4-
#' @format A data frame with X rows and X variables:
4+
#' @format A list of 256 elements of class S4 (`grImport::Picture`), with:
55
#' \describe{
6-
#' \item{state.name}{the name of the state}
7-
#' \item{state.abb}{the name of the abbreviation}
8-
#' \item{state.regex}{the regex for that state}
6+
#' \item{content}{PictureGroup}
7+
#' \item{defs}{PictureDefinitions}
8+
#' \item{summary}{PictureSummary}
99
#' ...
1010
#' }
11-
".flaglist"
11+
"lflags"

data/lflags.rda

281 KB
Binary file not shown.

man/dot-flaglist.Rd renamed to man/lflags.Rd

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)