@@ -128,7 +128,7 @@ next_after.Date = function(x) x + 1L
128128# ' key variables, and thus the key variables are critical for figuring out how
129129# ' to generate a snapshot of data from the archive, as of a given version.
130130# '
131- # ' In general, the last version of each observation is carried forward (LVCF ) to
131+ # ' In general, the last version of each observation is carried forward (LOCF ) to
132132# ' fill in data between recorded versions, and between the last recorded
133133# ' update and the `observed_versions_end`. One consequence is that the `DT`
134134# ' doesn't have to contain a full snapshot of every version (although this
@@ -230,8 +230,8 @@ epi_archive =
230230# ' @param compactify Optional; Boolean or `NULL`: should we remove rows that are
231231# ' considered redundant for the purposes of `epi_archive`'s built-in methods
232232# ' such as `as_of`? As these methods use the last version of each observation
233- # ' carried forward (LVCF ) to interpolate between the version data provided,
234- # ' rows that don't change these LVCF results can potentially be omitted to
233+ # ' carried forward (LOCF ) to interpolate between the version data provided,
234+ # ' rows that don't change these LOCF results can potentially be omitted to
235235# ' save space while maintaining the same behavior (with the help of the
236236# ' `clobberable_versions_start` and `observed_versions_end` fields in some
237237# ' edge cases). `TRUE` will remove these rows, `FALSE` will not, and missing
@@ -337,30 +337,30 @@ epi_archive =
337337 DT = as.data.table(x , key = key_vars )
338338 if (! identical(key_vars , key(DT ))) setkeyv(DT , cols = key_vars )
339339
340- # Checks to see if a value in a vector is LVCF
341- is_lvcf <- function (vec ) {
340+ # Checks to see if a value in a vector is LOCF
341+ is_locf <- function (vec ) {
342342 dplyr :: if_else(! is.na(vec ) & ! is.na(dplyr :: lag(vec )),
343343 vec == dplyr :: lag(vec ),
344344 is.na(vec ) & is.na(dplyr :: lag(vec )))
345345 }
346346
347- # LVCF is defined by a row where all values except for the version
347+ # LOCF is defined by a row where all values except for the version
348348 # differ from their respective lag values
349349
350- # Checks for LVCF 's in a data frame
351- rm_lvcf <- function (df ) {
352- dplyr :: filter(df ,if_any(c(everything(),- version ),~ ! is_lvcf (. )))
350+ # Checks for LOCF 's in a data frame
351+ rm_locf <- function (df ) {
352+ dplyr :: filter(df ,if_any(c(everything(),- version ),~ ! is_locf (. )))
353353 }
354354
355- # Keeps LVCF values, such as to be printed
356- keep_lvcf <- function (df ) {
357- dplyr :: filter(df ,if_all(c(everything(),- version ),~ is_lvcf (. )))
355+ # Keeps LOCF values, such as to be printed
356+ keep_locf <- function (df ) {
357+ dplyr :: filter(df ,if_all(c(everything(),- version ),~ is_locf (. )))
358358 }
359359
360360 # Runs compactify on data frame
361361 if (is.null(compactify ) || compactify == TRUE ) {
362- elim = keep_lvcf (DT )
363- DT = rm_lvcf (DT )
362+ elim = keep_locf (DT )
363+ DT = rm_locf (DT )
364364 } else {
365365 # Create empty data frame for nrow(elim) to be 0
366366 elim = tibble :: tibble()
@@ -370,7 +370,7 @@ epi_archive =
370370 if (is.null(compactify ) && nrow(elim ) > 0 ) {
371371 warning_intro <- break_str(paste(
372372 ' Found rows that appear redundant based on' ,
373- ' last (version of an ) observation carried forward;' ,
373+ ' last (version of each ) observation carried forward;' ,
374374 ' these rows have been removed to "compactify" and save space:'
375375 ))
376376
@@ -494,7 +494,7 @@ epi_archive =
494494# ' @importFrom data.table key setkeyv := address copy
495495# ' @importFrom rlang arg_match
496496 fill_through_version = function (fill_versions_end ,
497- how = c(" na" , " lvcf " )) {
497+ how = c(" na" , " locf " )) {
498498 validate_version_bound(fill_versions_end , self $ DT , na_ok = FALSE )
499499 how <- arg_match(how )
500500 if (self $ observed_versions_end < fill_versions_end ) {
@@ -532,8 +532,8 @@ epi_archive =
532532 # full result DT:
533533 setkeyv(rbind(self $ DT , next_version_DT ), key(self $ DT ))[]
534534 },
535- " lvcf " = {
536- # just the old DT; LVCF is built into other methods:
535+ " locf " = {
536+ # just the old DT; LOCF is built into other methods:
537537 self $ DT
538538 }
539539 )
@@ -557,7 +557,7 @@ epi_archive =
557557# ' @param y as in [`epix_merge`]
558558# ' @param observed_versions_end_conflict as in [`epix_merge`]
559559# ' @param compactify as in [`epix_merge`]
560- merge = function (y , observed_versions_end_conflict = c(" stop" ," na" ," lvcf " ," truncate" ), compactify = TRUE ) {
560+ merge = function (y , observed_versions_end_conflict = c(" stop" ," na" ," locf " ," truncate" ), compactify = TRUE ) {
561561 result = epix_merge(self , y ,
562562 observed_versions_end_conflict = observed_versions_end_conflict ,
563563 compactify = compactify )
@@ -751,8 +751,8 @@ epi_archive =
751751# ' @param compactify Optional; Boolean or `NULL`: should we remove rows that are
752752# ' considered redundant for the purposes of `epi_archive`'s built-in methods
753753# ' such as `as_of`? As these methods use the last version of each observation
754- # ' carried forward (LVCF ) to interpolate between the version data provided,
755- # ' rows that don't change these LVCF results can potentially be omitted to
754+ # ' carried forward (LOCF ) to interpolate between the version data provided,
755+ # ' rows that don't change these LOCF results can potentially be omitted to
756756# ' save space. `TRUE` will remove these rows, `FALSE` will not, and missing or
757757# ' `NULL` will remove these rows and issue a warning. Generally, this can be
758758# ' set to `TRUE`, but if you directly inspect or edit the fields of the
0 commit comments