-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort results by date (@
)
#118
Comments
You can just order according to the
Of course this does not mean that you are getting the latest 10 packages. Rather, it is the 10 packages with the highest rank, ordered by date. |
Yep, that works, but I'd rather avoid the piping and the dplyr dependency. Perhaps it's just me? 😅 |
I am pretty sure that you can sort a data frame without piping and dplyr, though, no? |
Yeeeah, but at least when I do it that wat, i.e. treating the search output as a There's probably a smarter way to do this (using x <- pkgsearch::pkg_search("testing")
x[order(x$date, decreasing = TRUE) The second operation causes |
This seems to work: x <- pkgsearch::pkg_search("testing")
x[] <- x[order(x$date, decreasing = TRUE), ]
x
|
In any case, my point is, it does not seems like a good solution to add a Many people use dplyr or data.table for manipulating data frames, so this is very easy for them, and if you need a no-dependency approach, that is also easy enough. In this particular case a Btw. there is probably a better way to query what you want. pkgsearch is good at ranking the results, but that's not what you need here. E.g. you could use |
Fair enough, thank you for the productive discussion! :) |
I often use
pkgsearch
to look up package submissions by me and my colleagues for our centre's monthly report. For that reason, it would be very useful for us to have the results ofadvanced_search()
ordered by date instead of the default (score?).I was about to submit a PR with a suggestion to add a
sort_by
parameter to thesummary.pkg_search_result()
method (maybeprint()
too?), but before putting in the work I'd like to check with you if that's something you're interested in seeing added to the package.The text was updated successfully, but these errors were encountered: