-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move the plots and plotting code. * Remove a few random old scripts. * Use native pipe and add package prefixes. * Add a README and NEWS. * Re-init renv.
- Loading branch information
1 parent
2adf56e
commit 2c15e68
Showing
28 changed files
with
1,317 additions
and
1,132 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# ryser-in-r (development version) | ||
|
||
# ryser-in-r (v0.1.0) | ||
|
||
* 6x6, 19x19 and 76x76 latin square examples | ||
* Not using keedwell | ||
* Based on tidygraph and igraph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
library(dplyr) | ||
library(ggplot2) | ||
library(here) | ||
library(igraph) | ||
library(purrr) | ||
library(tidygraph) | ||
library(tidyr) | ||
|
||
list.files("R", full.names = TRUE) |> walk(source) | ||
|
||
expand_grid(row = 1:3, column = 1:4) |> | ||
mutate( | ||
symbol = c(1, 3, 4, 2, 5, 6, 1, 3, 4, 2, 3, 5) | ||
) |> | ||
add_cols(5:19, 19) |> | ||
add_rows(4:19) |> | ||
mutate( | ||
original = case_when( | ||
row <= 3 & column <= 4 ~ TRUE, | ||
TRUE ~ FALSE | ||
) | ||
) |> | ||
ggplot(aes(column, row)) + | ||
geom_tile(aes(fill = symbol)) + | ||
geom_text(data = . |> filter(original), aes(label = symbol), size = 3, colour = "red") + | ||
geom_text(data = . |> filter(!original), aes(label = symbol), size = 2, colour = "white") + | ||
scale_y_reverse() + | ||
coord_fixed() + | ||
theme_void() + | ||
theme( | ||
legend.position = "none", | ||
) | ||
|
||
ggsave(here("plots", "19x19_ryser.png"), width = 3, height = 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
library(dplyr) | ||
library(ggplot2) | ||
library(here) | ||
library(igraph) | ||
library(purrr) | ||
library(tidygraph) | ||
library(tidyr) | ||
|
||
list.files("R", full.names = TRUE) |> walk(source) | ||
|
||
expand_grid(row = 1:3, column = 1:4) |> | ||
mutate(symbol = c(1, 3, 4, 2, 5, 6, 1, 3, 4, 2, 3, 5)) |> | ||
add_cols(5:6, 6) |> | ||
add_rows(4:6) |> | ||
ggplot(aes(column, row)) + | ||
geom_tile(aes(fill = symbol)) + | ||
geom_text(aes(label = symbol), size = 5, colour = "white") + | ||
scale_y_reverse() + | ||
coord_fixed() + | ||
theme_void() + | ||
theme( | ||
legend.position = "none", | ||
) | ||
|
||
ggsave(here("plots", "6x6_ryser.png"), width = 3, height = 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
library(dplyr) | ||
library(ggplot2) | ||
library(here) | ||
library(igraph) | ||
library(purrr) | ||
library(tidygraph) | ||
library(tidyr) | ||
|
||
list.files("R", full.names = TRUE) |> walk(source) | ||
|
||
expand_grid(row = 1:3, column = 1:4) |> | ||
mutate(symbol = c(1, 3, 4, 2, 5, 6, 1, 3, 4, 2, 3, 5)) |> | ||
add_cols(5:76, 76) |> | ||
add_rows(4:76) |> | ||
ggplot(aes(column, row)) + | ||
geom_tile(aes(fill = symbol)) + | ||
scale_y_reverse() + | ||
coord_fixed() + | ||
theme_void() + | ||
theme( | ||
legend.position = "none", | ||
) | ||
|
||
ggsave(here("plots", "76x76_ryser.png"), width = 3, height = 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# ryser-in-r | ||
|
||
## 6 x 6 | ||
|
||
![](plots/6x6_ryser.png) | ||
|
||
## 19 x 19 | ||
|
||
![](plots/19x19_ryser.png) | ||
|
||
## 76 x 76 | ||
|
||
![](plots/76x76_ryser.png) |
Oops, something went wrong.