From d7f20c9a72f77b54a12f7bebc220fec502829ecc Mon Sep 17 00:00:00 2001 From: Laurens van der burg Date: Wed, 17 May 2023 13:54:21 +0200 Subject: [PATCH] bugfix for header error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error in `purrr::map()`: ℹ In index: 1. Caused by error in `list_colnames[[1]][[i]]`: ! subscript out of bounds --- .gitignore | 2 ++ R/clean_header.R | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b0e893f..37f3777 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,5 @@ rsconnect/ .Rproj.user .DS_Store + +*.Rproj diff --git a/R/clean_header.R b/R/clean_header.R index ff58d06..46433c2 100644 --- a/R/clean_header.R +++ b/R/clean_header.R @@ -29,7 +29,7 @@ clean_header <- function(df) { list_colnames <- purrr::map(1:nrow(header), function(i) { header %>% dplyr::filter(dplyr::row_number() == i) %>% - dplyr::slice(.) %>% + #dplyr::slice(.) %>% c(., recursive=TRUE) %>% unname() })