Skip to content

Commit

Permalink
update README and vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
hneth committed May 7, 2024
1 parent 53f553d commit 6c71fa5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
13 changes: 6 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ n <- 50 # N
```

```{r unicol-pals-example-1-lists, echo = FALSE, eval = TRUE}
set.seed(147) # reproducible randomness
set.seed(155) # reproducible randomness
# A: Get sample_n of my_pals from all unicol_data$pal:
sample_n <- sort(sample(x = 1:N, size = n, replace = FALSE))
Expand Down Expand Up @@ -241,8 +241,8 @@ fig_main <- paste0("Illustrating ", n, " unicol palettes (with ", col_count,

```{r unicol-pals-example-1-stats, echo = FALSE, eval = FALSE}
# Stats (for n <- N):
n_pals # number of color palettes: 235 on 2023-09-14.
n_inst # number of institutions: 102 on 2023-09-14.
n_pals # number of color palettes: 273 on 2024-05-07.
n_inst # number of institutions: 102 on 2024-05-07.
# Colors (in current set):
col_count
length(unlist(pal_list)) # number of colors: 226 on 2023-09-14.
Expand Down Expand Up @@ -273,9 +273,9 @@ unikn::seecol(pal = pal_list,
<!-- ![Examples of 50 color palettes included in **unicol**.](./man/figures/README-unicol-pals-example-1-figure-1.png) -->


<!-- Example 2: Insights into clusters / relations / similar sets -->
<!-- Example 2: Explorations: Insights into clusters / relations / similar sets -->

```{r example-insights, echo = FALSE, eval = FALSE}
```{r example-explore-insights, echo = FALSE, eval = FALSE}
bg_col <- "grey95"
# Red and grey:
Expand Down Expand Up @@ -303,7 +303,7 @@ seecol(list(duke_1, jhu_1, columbia_1,
# Greens:
seecol(list(dartmouth_1, ohio_uni_1, limerick_1, stirling_1, lmu_1, fu_1),
seecol(list(dartmouth_1, ohio_uni_1, limerick_1, stirling_1, lmu_1, fu_1),
main = "Mostly green university colors", col_bg = bg_col)
Expand All @@ -323,7 +323,6 @@ seecol(list(notredame_1, uni_jena_1), main = "Color twins?", col_bg = bg_col)
```



### Using color palettes

As the **unicol** palettes are provided as vectors of R colors, they can simply be used as the `col` argument of R graphics functions.
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ library(unikn) # for color functions

## Contents

The **unicol** package currently provides **269 color palettes** from
The **unicol** package currently provides **273 color palettes** from
**116 institutions**.

<!-- **Table\ 1** provides an overview of all color palettes: -->
Expand All @@ -101,24 +101,24 @@ an overview of included color palettes and institutions.)

### Examples of color palettes

<!-- The **unicol** package currently contains **269\ color palettes** from **116\ institutions**. -->
<!-- The **unicol** package currently contains **273\ color palettes** from **116\ institutions**. -->
<!-- Example 1: Random pals (from vignette color_pals.Rmd): -->
<!-- Show as a table: -->
<!-- Show as a figure: -->

**Figure 1** illustrates 50 random color palettes (with 202 colors):
**Figure 1** illustrates 50 random color palettes (with 215 colors):

<div class="figure" style="text-align: center">

<img src="man/figures/README-unicol-pals-example-1-figure-1.png" alt="Figure 1: A sample of 50 unicol palettes (containing 202 colors)." width="680px" />
<img src="man/figures/README-unicol-pals-example-1-figure-1.png" alt="Figure 1: A sample of 50 unicol palettes (containing 215 colors)." width="680px" />
<p class="caption">
Figure 1: A sample of 50 unicol palettes (containing 202 colors).
Figure 1: A sample of 50 unicol palettes (containing 215 colors).
</p>

</div>

<!-- ![Examples of 50 color palettes included in **unicol**.](./man/figures/README-unicol-pals-example-1-figure-1.png) -->
<!-- Example 2: Insights into clusters / relations / similar sets -->
<!-- Example 2: Explorations: Insights into clusters / relations / similar sets -->

### Using color palettes

Expand Down Expand Up @@ -327,6 +327,6 @@ creators.

<!-- Footer: -->

\[File `README.Rmd` updated on 2024-05-02.\]
\[File `README.Rmd` updated on 2024-05-07.\]

<!-- eof. -->
Binary file modified man/figures/README-unicol-pals-example-1-figure-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions vignettes/color_pals.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ knitr::kable(all_pals_df, caption = tab_caption, row.names = TRUE)
```{r source-util-funs, echo = FALSE}
# 1. Utility functions: ------
source("../R/5_util.R")
wd <- getwd()
# source("./R/5_util.R") # from pkg wd
source("../R/5_util.R") # from pkg/vignettes dir
```

```{r unicol-data-table, echo = FALSE}
Expand Down Expand Up @@ -155,7 +158,7 @@ knitr::kable(my_df, caption = df_caption, col.names = col_names, row.names = TRU
N <- length(unicol_data$pal)
n <- 50 # N
set.seed(24) # reproducible randomness
set.seed(26) # reproducible randomness
# A: Get sample_n of my_pals from all unicol_data$pal:
sample_n <- sort(sample(x = 1:N, size = n, replace = FALSE))
Expand Down Expand Up @@ -224,6 +227,8 @@ unikn::seecol(pal = pal_list,
main = my_main)
```

<!-- Use and show figure generated from README file: -->

![**Figure 1:** Examples of **unicol** color palettes.](../man/figures/README-unicol-pals-example-1-figure-1.png)


Expand Down

0 comments on commit 6c71fa5

Please sign in to comment.