# Randomize a single value
x <- 0.5
new_value <- phytoclass:::Randomise_elements(x, 0.99, 1.01) # +/- 1% change
# Handle small values
small_x <- 0.0005
new_small <- phytoclass:::Randomise_elements(small_x, 0.99, 1.01) # will use 0.001
Run the code above in your browser using DataLab