Learn R Programming

scidb (version 1.1-2)

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

## S3 method for class 'scidb':
na.locf(object, along=dimensions(object)[1],`eval`=FALSE)

Arguments

object
A scidb or scidbdf object.
along
A single SciDB array dimension name to replace missing values along.
eval
(Optional) If true, execute the query and store the reult array. Otherwise defer evaluation.

Value

  • A 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! 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.