Skip to content

Commit

Permalink
as.character for rle
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouni Helske committed Jan 20, 2025
1 parent b33d85e commit ef01890
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/fill_time.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fill_time <- function(data, id_var, time_var) {
n_group <- length(ids)
time_duplicated <- logical(n_group)
time_missing <- logical(n_group)
group_bounds <- c(0L, cumsum(rle(data[[id_var]])$lengths))
group_bounds <- c(0L, cumsum(rle(as.character(data[[id_var]]))$lengths))
for (i in seq_len(n_group)) {
idx_group <- seq(group_bounds[i] + 1L, group_bounds[i + 1L])
sub <- data[idx_group, ]
Expand Down

0 comments on commit ef01890

Please sign in to comment.