50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

scidb (version 1.2-0)

na.locf-methods: Methods for Function na.locf in Package scidb

Description

Generic function for replacing each missing or empty value with the most recent non-missing value prior to it.

Usage

"na.locf"(object, along=dimensions(object)[1],fill_sparse=FALSE,`eval`=FALSE)

Arguments

object
A scidb or scidbdf object.
along
A single SciDB array dimension name to replace missing values along.
fill_sparse
Specify TRUE to impute sparse values, leave as the default FALSE to only impute missing (SciDB NULL) values.
eval
(Optional) If true, execute the query and store the reult array. Otherwise defer evaluation.

Value

scidb reference object.

Details

Unlike the usual na.locf function from the zoo package, the SciDB na.locf function fills in both missing (SciDB null values) and empty (SciDB sparse) values with the last non-missing and non-sparse value along the indicated dimension.

Time series represented in SciDB are often sparse arrays. The na.locf function defines a conveniet way to fill in all missing values along the time coordinate axis down to the time resolution.

Caution! If fill_sparse=TRUE then the output array is a mostly dense, filled-in version of the input array. If the time resolution is very fine and the input array very sparse, then the output array can be huge. Consider using regrid first on very fine time scales to reduce their resolution.