Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

trim_trailing

Strip leading / trailing zeros


Description

Removes value from rightmost/leftmost elements of a vector.

Usage

trim_trailing(x, value = 0)

trim_leading(x, value = 0)

Arguments

x

a vector

value

a value to strip from x

Value

a new vector, with values at the right removed

Author(s)

References

Examples

trim_leading(c(0,0,0,0,1:5))

stackoverflow

Stack Overflow's Greatest Hits

v0.7.0
CC BY-SA 4.0
Authors
Neal Fultz <nfultz@gmail.com> and the StackOverflow.com community
Initial release
2020-01-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.