Skip to content

Commit

Permalink
colour text by background
Browse files Browse the repository at this point in the history
  • Loading branch information
drmowinckels committed Sep 27, 2022
1 parent 6c375e9 commit cddb885
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 248 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: gbhs
Title: Lifebrain Global Brain Health Survey Data
Version: 0.0.0.9000
Version: 0.0.1
Authors@R: c(
person("Athanasia Mo", "Mowinckel",
email = "a.m.mowinckel@psykologi.uio.no",
Expand Down
44 changes: 22 additions & 22 deletions inst/docs/child_docs/ord_desc.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ if(l > base_fig_height)
```{r , fig.height=base_fig_height}
data |>
ggstacked(
lab = ifelse(!grepl(pattern, value), pc, NA),
col = ifelse(!grepl(pattern, value), "black", "white"),
lab = ifelse(grepl(pattern, value), pc, NA),
col = ifelse(grepl(pattern, value), "black", "white"),
n_breaks = 5,
) +
labs(x="", y="", fill = "Response",
Expand All @@ -39,8 +39,8 @@ data |>
min_pc = .2,
text_size = 2,
size = 1.5,
lab = ifelse(!grepl(pattern, value), pc, NA),
col = ifelse(!grepl(pattern, value), "black", "white")
lab = ifelse(grepl(pattern, value), pc, NA),
col = ifelse(grepl(pattern, value), "black", "white")
) &
coord_cartesian(clip = "off") &
plot_annotation(
Expand All @@ -60,8 +60,8 @@ data |>
npos = 1.25,
min_pc = .2,
size = 1.5,
lab = ifelse(!grepl(pattern, value), pc, NA),
col = ifelse(!grepl(pattern, value), "black", "white")
lab = ifelse(grepl(pattern, value), pc, NA),
col = ifelse(grepl(pattern, value), "black", "white")
) &
coord_cartesian(xlim = c(0, 1.4), clip = "off") &
plot_annotation(
Expand All @@ -81,8 +81,8 @@ data |>
npos = 1.3,
min_pc = .2,
size = 1.5,
lab = ifelse(!grepl(pattern, value), pc, NA),
col = ifelse(!grepl(pattern, value), "black", "white")
lab = ifelse(grepl(pattern, value), pc, NA),
col = ifelse(grepl(pattern, value), "black", "white")
) &
coord_cartesian(xlim = c(0, 1.4), clip = "off") &
theme(axis.text.y = element_text(size=6)) &
Expand All @@ -103,8 +103,8 @@ data |>
npos = 1.3,
min_pc = .2,
size = 1.5,
lab = ifelse(!grepl(pattern, value), pc, NA),
col = ifelse(!grepl(pattern, value), "black", "white")
lab = ifelse(grepl(pattern, value), pc, NA),
col = ifelse(grepl(pattern, value), "black", "white")
) &
coord_cartesian(xlim = c(0, 1.4), clip = "off") &
theme(axis.text.y = element_text(size=7)) &
Expand All @@ -125,8 +125,8 @@ data |>
npos = 1.3,
min_pc = .2,
size = 1.5,
lab = ifelse(!grepl(pattern, value), pc, NA),
col = ifelse(!grepl(pattern, value), "black", "white")
lab = ifelse(grepl(pattern, value), pc, NA),
col = ifelse(grepl(pattern, value), "black", "white")
) &
coord_cartesian(xlim = c(0, 1.4), clip = "off") &
theme(axis.text.y = element_text(size=7)) &
Expand All @@ -148,8 +148,8 @@ data |>
npos = 1.3,
min_pc = .2,
size = 1.5,
lab = ifelse(!grepl(pattern, value), pc, NA),
col = ifelse(!grepl(pattern, value), "black", "white")
lab = ifelse(grepl(pattern, value), pc, NA),
col = ifelse(grepl(pattern, value), "black", "white")
) &
coord_cartesian(xlim = c(0, 1.4), clip = "off") &
theme(axis.text.y = element_text(size=7)) &
Expand All @@ -171,8 +171,8 @@ data |>
npos = 1.3,
min_pc = .2,
size = 1.5,
lab = ifelse(!grepl(pattern, value), pc, NA),
col = ifelse(!grepl(pattern, value), "black", "white")
lab = ifelse(grepl(pattern, value), pc, NA),
col = ifelse(grepl(pattern, value), "black", "white")
) &
coord_cartesian(xlim = c(0, 1.4), clip = "off") &
theme(axis.text.y = element_text(size=7)) &
Expand All @@ -194,8 +194,8 @@ data |>
npos = 1.3,
min_pc = .2,
size = 1.5,
lab = ifelse(!grepl(pattern, value), pc, NA),
col = ifelse(!grepl(pattern, value), "black", "white")
lab = ifelse(grepl(pattern, value), pc, NA),
col = ifelse(grepl(pattern, value), "black", "white")
) &
coord_cartesian(xlim = c(0, 1.4), clip = "off") &
theme(axis.text.y = element_text(size=7)) &
Expand All @@ -216,8 +216,8 @@ data |>
npos = 1.3,
min_pc = .2,
size = 1.5,
lab = ifelse(!grepl(pattern, value), pc, NA),
col = ifelse(!grepl(pattern, value), "black", "white")
lab = ifelse(grepl(pattern, value), pc, NA),
col = ifelse(grepl(pattern, value), "black", "white")
) &
coord_cartesian(xlim = c(0, 1.4), clip = "off") &
theme(axis.text.y = element_text(size=7)) &
Expand All @@ -238,8 +238,8 @@ data |>
npos = 1.3,
min_pc = .2,
size = 1.5,
lab = ifelse(!grepl(pattern, value), pc, NA),
col = ifelse(!grepl(pattern, value), "black", "white")
lab = ifelse(grepl(pattern, value), pc, NA),
col = ifelse(grepl(pattern, value), "black", "white")
) &
coord_cartesian(xlim = c(0, 1.4), clip = "off") &
theme(axis.text.y = element_text(size=7)) &
Expand Down
225 changes: 0 additions & 225 deletions inst/docs/paper1/descriptives.knit.md

This file was deleted.

0 comments on commit cddb885

Please sign in to comment.