From f8ef9c3dbe74f59a282373db3ec20897d16c3830 Mon Sep 17 00:00:00 2001 From: "Jarod G.R. Meng" Date: Sat, 19 Jun 2021 22:45:23 +0800 Subject: [PATCH] Restrict bad renamed column name matching to whole word OHLCV names --- R/tq_mutate.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/tq_mutate.R b/R/tq_mutate.R index 5e8644d5..9c8c8c6a 100644 --- a/R/tq_mutate.R +++ b/R/tq_mutate.R @@ -339,7 +339,7 @@ detect_duplicates <- function(name_list) { # bad / restricted names are names that get selected unintetionally by OHLC functions replace_bad_names <- function(tib, fun_name) { - bad_names_regex <- "open|high|low|close|volume|adjusted|price" + bad_names_regex <- "^(open|high|low|close|volume|adjusted|price)$" name_list_tib <- colnames(tib) name_list_tib_lower <- stringr::str_to_lower(name_list_tib)