Are there ways to randomly sample among ties in the R function which.max()? – stackoverflow.com

I currently am using the which.max() function in R within a loop. Sometimes, I have a vector which contains the same elements, like: vec <- c(0,0,2,0,2) The function will then always return: ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "Are there ways to randomly sample among ties in the R function which.max()? – stackoverflow.com"