R (programming language): What new happen in the field of top-k query processing and optimization in relational database system
-
-
Answer:
I would do: head(df[order(df$col, decreasing=T), ], k)
Michael Hochster at Quora Visit the source
Other answers
1. Base R df[with(df, order(col, decreasing=T)), ][1:k, ] 2. Using plyr arrange(df, -col)[1:k,] 3. Using sqldf sqldf("SELECT * FROM df ORDER BY col DESC LIMIT k")
Jeff Hammerbacher
Related Q & A:
- What are the common usage of python programming language?Best solution by quora.com
- What is a "modern" programming language?Best solution by Quora
- Which is the best programming language?Best solution by Yahoo! Answers
- What celebrations happen in New York City on 4th July?Best solution by Yahoo! Answers
- What programming language would be appropriate for better job opportunities?Best solution by quora.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.