trim_val | R Documentation |
the range a value may take is restricted to by an upper and lower boundary. If it exceeds the boundary the value is replaced by the boundary value or alternatively by NA
trim_val(x, minmax = c(-Inf, Inf), na = FALSE)
x |
numeric vector |
minmax |
minimal and maximal possible value (default c(-Inf, Inf) i.e. no trimming occurs) |
na |
Use NAs for replacing values that are out of range |
vector vector whose elements that are out of range are replaced
trim_val(30)
trim_val(30, c(10, 20))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.