Skip to content

Commit eca46d5

Browse files
authored
Merge pull request #43 from nanxstats/data-raw
Replace `sysdata.rda` with code
2 parents 2061426 + 69bef01 commit eca46d5

File tree

5 files changed

+14
-62
lines changed

5 files changed

+14
-62
lines changed

.Rbuildignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
^pkgdown$
77
^docs$
88

9-
^data-raw$
109
^CONTRIBUTING\.md$
1110
^CODE_OF_CONDUCT\.md$
1211
^LICENSE\.md$

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: ggsci
22
Type: Package
33
Title: Scientific Journal and Sci-Fi Themed Color Palettes for 'ggplot2'
4-
Version: 3.1.0
4+
Version: 3.1.0.9000
55
Authors@R: c(
66
person("Nan", "Xiao", email = "me@nanx.me", role = c("aut", "cre"),
77
comment = c(ORCID = "0000-0002-0250-5673")),

NEWS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# ggsci 3.1.0.9000
2+
3+
## Improvements
4+
5+
- Move internal color palette data from `R/sysdata.rda` to `R/palettes.R`.
6+
This change enhances package development transparency, reduces unnecessary
7+
indirection, and simplifies contributions by avoiding the construction
8+
of the palette data using the R script in `data-raw/` (#42).
9+
110
# ggsci 3.1.0
211

312
## New features

data-raw/data-generator.R renamed to R/palettes.R

Lines changed: 4 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# Generate internal color palettes data `R/sysdata.rda`:
2-
# - R Packages - Internal data. <https://r-pkgs.org/data.html#sec-data-sysdata>
3-
# - Name that Color. <http://chir.ag/projects/name-that-color/>
1+
# Construct color palettes data
2+
#
3+
# If not available, the color names are generated by "Name that Color" at
4+
# <http://chir.ag/projects/name-that-color/>.
45

56
ggsci_db <- vector("list")
67

@@ -487,60 +488,3 @@ ggsci_db$"material"$"blue-grey" <- c(
487488
"BlueGrey600" = "#546E7A", "BlueGrey700" = "#455A64",
488489
"BlueGrey800" = "#37474F", "BlueGrey900" = "#263238"
489490
)
490-
491-
save(ggsci_db, file = "R/sysdata.rda")
492-
493-
test_barplot <- function(palette, type) {
494-
pal <- ggsci_db[[palette]][[type]]
495-
barplot(rep(1, length(pal)), col = pal)
496-
}
497-
498-
test_barplot("npg", "nrc")
499-
test_barplot("aaas", "default")
500-
test_barplot("nejm", "default")
501-
test_barplot("lancet", "lanonc")
502-
test_barplot("jama", "default")
503-
test_barplot("bmj", "default")
504-
test_barplot("jco", "default")
505-
test_barplot("ucscgb", "default")
506-
test_barplot("d3", "category10")
507-
test_barplot("d3", "category20")
508-
test_barplot("d3", "category20b")
509-
test_barplot("d3", "category20c")
510-
test_barplot("locuszoom", "default")
511-
test_barplot("igv", "default")
512-
test_barplot("igv", "alternating")
513-
test_barplot("uchicago", "default")
514-
test_barplot("uchicago", "light")
515-
test_barplot("uchicago", "dark")
516-
test_barplot("cosmic", "hallmarks_dark")
517-
test_barplot("cosmic", "hallmarks_light")
518-
test_barplot("cosmic", "signature_substitutions")
519-
test_barplot("startrek", "uniform")
520-
test_barplot("tron", "legacy")
521-
test_barplot("futurama", "planetexpress")
522-
test_barplot("rickandmorty", "schwifty")
523-
test_barplot("simpsons", "springfield")
524-
test_barplot("gsea", "default")
525-
test_barplot("flatui", "default")
526-
test_barplot("flatui", "flattastic")
527-
test_barplot("flatui", "aussie")
528-
test_barplot("material", "red")
529-
test_barplot("material", "pink")
530-
test_barplot("material", "purple")
531-
test_barplot("material", "deep-purple")
532-
test_barplot("material", "indigo")
533-
test_barplot("material", "blue")
534-
test_barplot("material", "light-blue")
535-
test_barplot("material", "cyan")
536-
test_barplot("material", "teal")
537-
test_barplot("material", "green")
538-
test_barplot("material", "light-green")
539-
test_barplot("material", "lime")
540-
test_barplot("material", "yellow")
541-
test_barplot("material", "amber")
542-
test_barplot("material", "orange")
543-
test_barplot("material", "deep-orange")
544-
test_barplot("material", "brown")
545-
test_barplot("material", "grey")
546-
test_barplot("material", "blue-grey")

R/sysdata.rda

-5.99 KB
Binary file not shown.

0 commit comments

Comments
 (0)