Add find.threshold to R common funs