max_trim_single: Converts output from max_shift() to a shifted vector Trims a...

Description Usage Arguments Value Examples

Description

Given a vector, this function will trim it according to the output from max_trim_single. max_trim_single will trim directly the number of elements specified by max_shift, with no input from the number of features. In order to trim the vector by the number of features present max_trim should be used instead of max_trim_single.

Usage

1

Arguments

vector

Vector to be trimmed

max_shift

Character containing direction and number of elements to trim in that direction, or '0' for no trim. e.g '+2'.

Value

vector_out The trimmed vector

Examples

1
2
3
4
5
6
# example data
v <- seq(1, 10, 1)

max_trim_single(v, '+2')
max_trim_single(v, '-3')
max_trim_single(v, '0')

Swarchal/TISS documentation built on May 9, 2019, 3:24 p.m.