From 72897ca34d81ad4316a5d7a740e639b44dcff435 Mon Sep 17 00:00:00 2001 From: Mitchell O'Hara-Wild Date: Wed, 26 Jun 2024 10:28:20 +0200 Subject: [PATCH] Fix key comparison for column selection matching non-syntactical names (#306) Resolves #305 --- R/subset.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/subset.R b/R/subset.R index 2e18049d..2337f204 100644 --- a/R/subset.R +++ b/R/subset.R @@ -51,7 +51,7 @@ } new_key <- cn[cn %in% key_vars(x)] - maybe_tsibble <- n_keys(x) > 1 && !all(is.element(key(x), new_key)) + maybe_tsibble <- n_keys(x) > 1 && !all(is.element(key_vars(x), new_key)) # Column subsetting only if (is_null(i) && !is_null(j) && maybe_tsibble) return(as_tibble(res))