From 6a8d51ae45f9cbd67e56dbefa40c6dd0b43d543e Mon Sep 17 00:00:00 2001 From: Jan Marvin Garbuszus Date: Thu, 2 Nov 2023 20:31:22 +0100 Subject: [PATCH] cleanup code --- R/class-worksheet.R | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/R/class-worksheet.R b/R/class-worksheet.R index d3738daa5..79230cc42 100644 --- a/R/class-worksheet.R +++ b/R/class-worksheet.R @@ -449,11 +449,12 @@ wbWorksheet <- R6::R6Class( out <- NULL for (i in seq_len(nrow(col_df))) { - z_i <- col_df[i, ] - - z <- z_i[rep(seq_len(nrow(z_i)), length(seq(z_i$min, z_i$max))), ] - z$key <- seq(z_i$min, z_i$max) - out <- rbind(out, z) + z <- col_df[i, ] + keys <- seq.int(z$min, z$max) + + out_tmp <- z[rep(1L, length(keys)), ] + out_tmp$key <- keys + out <- rbind(out, out_tmp) } # merge and convert to character, remove key