leadtrail | R Documentation |
Remove leading or trailing zeros or NAs from a vector.
leadtrail(
x,
rm = c("zeros", "na"),
lead = c(TRUE, FALSE),
trail = c(TRUE, FALSE)
)
x |
vector of values to check. |
rm |
what to remove, can be |
lead |
If |
trail |
If |
Resulting vector.
Nikolaos Kourentzes, nikolaos@kourentzes.com.
x <- c(rep(0,5),rnorm(100),rep(0,5))
leadtrail(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.