Skip to content

Commit

Permalink
Fix unique col naming issue with tibble
Browse files Browse the repository at this point in the history
  • Loading branch information
mrustl committed Jun 28, 2024
1 parent 7f5fb24 commit 7fec900
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/read_balance.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ balance <- do.call(rbind, lapply(float_numbers_list, function(x) {
length(x) <- 3 # Setze die Länge auf 3, um sicherzustellen, dass alle Einträge drei Spalten haben
return(x)
})) %>%
tibble::as_tibble()
as.data.frame()

names(balance) <- sprintf("id_%d", subregion_ids)
# Erstellen eindeutiger Spaltennamen
colnames(balance) <- make.names(sprintf("id_%d", subregion_ids), unique = TRUE)

balance <- tibble::as_tibble(balance)

parvals <- block_sel_txt[bal_id_start:bal_id_end] %>%
stringr::str_remove_all("-?\\d*\\.\\d+(?:E[+-]?\\d+)?") %>%
Expand Down Expand Up @@ -97,3 +99,4 @@ dplyr::bind_cols(tibble::tibble(time = time,


}

0 comments on commit 7fec900

Please sign in to comment.