[R] Finding top 25% observations in Dplyr
Shivi82
shivibhatia at ymail.com
Thu Aug 13 12:14:38 CEST 2015
Hi All, I am working on a dataset baseball where i am grouping based on one
var income in descending order.
Now i need to find the top 25% of the observations from the income group for
which i used top_n (0.25) but it is not finding the desired.
Can you please suggest.
Baseball%>%
group_by(income)%>% top_n(0.25,income)%>%
arrange(desc(income))
--
View this message in context: http://r.789695.n4.nabble.com/Finding-top-25-observations-in-Dplyr-tp4711061.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list