], n=3))
>
>#Get them with names
>get.n<- function(x, names, n) {
> rmin<-
> rv<-x[w<-which(rank(x)> length(x)-n)]
> names(rv)<-names[w]
> return(as.data.frame(rv))
>}
>
>apply(d,1,get.n, n=3, names=names(d))
>
&g
Hello,
i have a dataframe with the GDP for different Country (in the columns) and
Years (in the rows).
Now i want for every year the best three values, if possible with name of
the countries (columnnames).
For the best it's no problem but for the other two values.
Thanks,
2 matches
Mail list logo