Skip to content
Prev 263074 / 398502 Next

how to get the miminum value in the list

Hi, that depends on whether you want to get the minimum within each list
element or the global minimum across all list elements. The first is
achieved by using lapply(). The second can be achieved by unlisting the list
(which assumes that all list elements are numeric) and looking for its
minimum.

x<-list(c(1,5),c(2,3,4))
lapply(x,min)
min(unlist(x))

HTH,
Daniel
jiliguala wrote:
--
View this message in context: http://r.789695.n4.nabble.com/how-to-get-the-miminum-value-in-the-list-tp3609013p3609325.html
Sent from the R help mailing list archive at Nabble.com.