check_weights {LDATS} | R Documentation |
Check that weights vector is proper
Description
Check that the vector of document weights is numeric and positive and inform the user if the average weight isn't 1.
Usage
check_weights(weights)
Arguments
weights |
Vector of the document weights to evaluate, or |
Value
An error message is thrown if weights
is not proper,
else NULL
.
Examples
check_weights(1)
wts <- runif(100, 0.1, 100)
check_weights(wts)
wts2 <- wts / mean(wts)
check_weights(wts2)
check_weights(TRUE)
[Package LDATS version 0.3.0 Index]