sort_by_index: sort_by_index

View source: R/internals.R

sort_by_indexR Documentation

sort_by_index

Description

internal function such as sortByIndex as in package dplR, shifts series to start with index 1, maintaining the same vector length by adding NA values to the end.

Usage

sort_by_index(x)

Arguments

x

a numeric vector, representing an individual rwl series, potentially containing NA values.

Value

a numeric vector with the same length as x.

Examples

x <- c(NA,NA,NA,1,2,3,4,5, NA, NA)
iadf:::sort_by_index(x)
#[1]  1  2  3  4  5 NA NA NA NA NA

iadf documentation built on April 12, 2025, 1:31 a.m.