If data is a vector or a raster object, then the threshold should be a
numeric value. If data is matrix,dataframe or rasterStack, then the
threshold should have, in theory, as many values as the number of
columns or layers to transform.
In the particular case that the data to convert is a
matrix
/data.frame
with several columns or a
RasterStack
with several layers and the threshold is a single
numeric value, the same threshold will be applied to all columns
(resp. layers).