bumped to 25.2.1 - new visuals tab - all functions in place - code cleanup has started

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-02-25 09:51:42 +01:00
commit 14edce9912
No known key found for this signature in database
36 changed files with 3564 additions and 2976 deletions

View file

@ -266,3 +266,29 @@ remove_empty_cols <- function(data,cutoff=.7){
}) >= cutoff
data[filter]
}
#' Append list with named index
#'
#' @param data data to add to list
#' @param list list
#' @param index index name
#'
#' @returns list
#'
#' @examples
#' ls_d <- list(test=c(1:20))
#' ls_d <- list()
#' data.frame(letters[1:20],1:20) |> append_list(ls_d,"letters")
#' letters[1:20]|> append_list(ls_d,"letters")
append_list <- function(data,list,index){
## This will overwrite and not warn
## Not very safe, but convenient to append code to list
if (index %in% names(list)){
list[[index]] <- data
out <- list
} else {
out <- setNames(c(list,list(data)),c(names(list),index))
}
out
}