Learn R Programming

timefully (version 0.1.0)

fill_down_until: Fill down tibble columns until a maximum number of time slots

Description

Fill down tibble columns until a maximum number of time slots

Usage

fill_down_until(dtf, varnames, max_timeslots = 1)

Value

tibble

Arguments

dtf

data.frame or tibble, first column of name datetime being of class datetime and rest of columns being numeric

varnames

character or vector of characters, column names with NA values

max_timeslots

integer, maximum number of time slots to fill

Examples

Run this code
down_data <- data.frame(
  datetime = as.POSIXct("2024-01-01 00:00:00", tz = "UTC") + 0:5 * 3600,
  temperature = c(15, 15, NA, NA, NA, 16)
)
fill_down_until(down_data, "temperature", max_timeslots = 2)

Run the code above in your browser using DataLab