If you just want the value which is the most frequent try
as.numeric(names(which.max(table(c( -295.8045 ,-295.8045, -295.8045, -295.8045 ,-325.4754 ,-295.8045, -295.8045, -295.8045, -413.2099, -295.8045)))))
[1] -295.8045 There may be easier ways Regards Duncan Mackay Department of Agronomy and Soil Science University of New England ARMIDALE NSW 2351 Email: home: [EMAIL PROTECTED] At 16:04 10/07/2008, you wrote:
Hi, Is there a way to do it? For example I have the following vector: > print(myvector) > [1] -295.8045 -295.8045 -295.8045 -295.8045 -325.4754 -295.8045 -295.8045 [8] -295.8045 -413.2099 -295.8045 I want it to return -295.8045, which occur most often. - Gundala Viswanath Jakarta - Indonesia ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.