You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recently been using the package you developed—great work! However, when I forget to use findClusters, it still runs without errors, which prevents me from noticing my mistake.Could you please add some exception handling code?
function (annotations)
{
# Check if annotations is NULL or empty
if (is.null(annotations) || length(annotations) == 0) {
stop("Input 'annotations' cannot be NULL or empty.")
}
# Check if annotations is a vector
if (!is.vector(annotations)) {
stop("Input 'annotations' must be a vector.")
}
# Calculate the frequency of each annotation
anno.freq <- table(annotations) / length(annotations)
# Calculate the sum of squared frequencies
x <- sum(anno.freq^2)
# Return the result
return(x)
}
The text was updated successfully, but these errors were encountered:
I've recently been using the package you developed—great work! However, when I forget to use findClusters, it still runs without errors, which prevents me from noticing my mistake.Could you please add some exception handling code?
The text was updated successfully, but these errors were encountered: