Skip to content
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

A wrapper function for search? #287

Open
trangdata opened this issue Oct 9, 2024 · 2 comments
Open

A wrapper function for search? #287

trangdata opened this issue Oct 9, 2024 · 2 comments
Labels
enhancement New feature or request vignette

Comments

@trangdata
Copy link
Collaborator

trangdata commented Oct 9, 2024

I recently received a question about search and realized that the user would have to learn about more advanced arguments like pages and options to do a simple search. A helper functions would make it easier and feel less advanced. But perhaps we should first start with a search vignette? What do you think @massimoaria @yjunechoe?

Suppose the user want to search for any publications with links between BRAF and melanoma. oa_fetch(search = "BRAF and melanoma", verbose = TRUE) would take too long (54710 records total). Often we just want the top, say, 100 results (ranked based on relevance or citation count).
So, we would have to do:

openalexR::oa_fetch(
  search = "BRAF and melanoma", 
  pages = 1,
  per_page = 100,
  # options = list(sort = "cited_by_count:desc"),
  verbose = TRUE
)

The corresponding pubmed search is

result <- rentrez::entrez_search(db = "pubmed", term = "BRAF and melanoma", retmax = 100)
@trangdata trangdata added enhancement New feature or request vignette labels Oct 9, 2024
@yjunechoe
Copy link
Collaborator

Always down to have for more vignettes, time and resource permitting :)

On a wrapper function, would you imagine something like a oa_search() that wraps oa_fetch() with options relevant to searching promoted as function arguments?

@trangdata
Copy link
Collaborator Author

Yes that's what I was thinking.

trangdata added a commit that referenced this issue Oct 15, 2024
trangdata added a commit that referenced this issue Oct 16, 2024
* a search vignette, working on #287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vignette
Projects
None yet
Development

No branches or pull requests

2 participants