Check that the vector of document weights is numeric and positive and inform the user if the average weight isn't 1.
check_weights(weights)
weights | Vector of the document weights to evaluate, or |
---|
An error message is thrown if weights
is not proper,
else NULL
.
check_weights(1) wts <- runif(100, 0.1, 100) check_weights(wts) wts2 <- wts / mean(wts) check_weights(wts2) check_weights(TRUE)