From 2b1cc987bd8eba3d0ffcbfbb3138324c78ee1e1c Mon Sep 17 00:00:00 2001 From: Ben Raymond Date: Thu, 25 Apr 2024 12:05:32 +1000 Subject: [PATCH] allow skills to be missing from winning symbols df --- R/meta.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/meta.R b/R/meta.R index 999c0e7..dba6f79 100644 --- a/R/meta.R +++ b/R/meta.R @@ -291,7 +291,7 @@ winning_symbols_df <- function(txt) { } winning_symbols_df2txt <- function(x) { - if (!is.data.frame(x) || !setequal(names(x), c("skill", "win_lose", "code")) || !all(c("S", "R", "A", "B", "D", "E", "F") %in% x$skill)) stop("input in unexpected format") + if (!is.data.frame(x) || !setequal(names(x), c("skill", "win_lose", "code"))) stop("input in unexpected format") tildepad <- function(z) paste0(paste0(z, collapse = ""), paste0(rep("~", 4 - length(z)), collapse = "")) out <- vapply(c("S", "R", "A", "B", "D", "E", "F"), function(z) { paste0(tildepad(x$code[x$skill == z & x$win_lose == "L"]), tildepad(x$code[x$skill == z & x$win_lose == "W"]))