sort_by_index: sort_by_index

Description Usage Arguments Value Examples

Description

internal function sortByIndex from package dplR, shifts series to start with index 1, maintaining the same vector length by adding NA values to the end. Code copied and not imported to make function name consistent to naming convention in package trlboku and to provide documentation.

Usage

1

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

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

konradmayer/trlboku documentation built on July 3, 2020, 9:49 p.m.