| Title: | Query Search Interfaces and AI Assistants |
|---|---|
| Description: | Provides search interfaces to look up terms on major search engines including 'Google', 'Bing', 'DuckDuckGo', 'Startpage', 'Ecosia', 'Brave', 'Kagi', 'rseek', social platforms like 'X' (formerly Twitter), 'BlueSky', 'Mastodon', programming communities such as 'StackOverflow', 'Posit Community', and code repositories including 'GitHub', 'grep.app', and 'BitBucket'. Additionally, provides direct integration with AI assistants through specialized query functions for 'ChatGPT', 'Claude AI', 'Perplexity AI', 'Mistral AI', 'Microsoft Copilot', and 'Meta AI', complete with an AI prompt management system for R-optimized interactions. Upon searching or querying, a browser window will open with the search results or AI interface pre-populated with the specified query. |
| Authors: | James Balamuta [aut, cre] (ORCID: <https://orcid.org/0000-0003-2826-8458>), Alex Rossell Hayes [ctb] (ORCID: <https://orcid.org/0000-0001-9412-0457>) |
| Maintainer: | James Balamuta <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.1.0 |
| Built: | 2026-05-22 06:11:51 UTC |
| Source: | https://github.com/coatless-rpkg/searcher |
Provides search interfaces to look up terms on major search engines including 'Google', 'Bing', 'DuckDuckGo', 'Startpage', 'Ecosia', 'Brave', 'Kagi', 'rseek', social platforms like 'X' (formerly Twitter), 'BlueSky', 'Mastodon', programming communities such as 'StackOverflow', 'Posit Community', and code repositories including 'GitHub', 'grep.app', and 'BitBucket'. Additionally, provides direct integration with AI assistants through specialized query functions for 'ChatGPT', 'Claude AI', 'Perplexity AI', 'Mistral AI', 'Microsoft Copilot', and 'Meta AI', complete with an AI prompt management system for R-optimized interactions. Upon searching or querying, a browser window will open with the search results or AI interface pre-populated with the specified query.
searcher accesses a set of default values stored in options() on each
call to keep the function signatures small. By default, these options are given as:
searcher.launch_delay: Amount of time to remain in R before opening
a browser window. Default is 0.5 seconds.
searcher.use_rstudio_viewer: Display search results in the RStudio
viewer pane instead of a web browser. Default is FALSE.
searcher.default_keyword: Suffix keyword to generate accurate results
between either "base" or "tidyverse". Default is "base".
Other options are used to set the default prompts for AI services
searcher.chatgpt_prompt: Default prompt for OpenAI's ChatGPT.
searcher.claude_prompt: Default prompt for Anthropic's Claude AI.
searcher.perplexity_prompt: Default prompt for Perplexity AI.
searcher.mistral_prompt: Default prompt for Mistral AI's Le Chat.
searcher.bing_copilot_prompt: Default prompt for Microsoft's (Bing) Copilot.
searcher.grok_prompt: Default prompt for xAI's Grok AI.
searcher.meta_ai_prompt: Default prompt for Meta's AI.
Maintainer: James Balamuta [email protected] (ORCID)
Other contributors:
Alex Rossell Hayes [email protected] (ORCID) [contributor]
Useful links:
Report bugs at https://github.com/coatless-rpkg/searcher/issues
Sets a system-level prompt to be used with all AI search functions. When called with no arguments, returns the currently active prompt.
ai_prompt(prompt_name = NULL)ai_prompt(prompt_name = NULL)
prompt_name |
Name of a prompt from the prompt library, or a custom prompt text.
Use |
Invisibly returns the active prompt text. If called without arguments, returns the active prompt visibly.
## Not run: # Set a predefined prompt ai_prompt("debugging") # Set a custom prompt ai_prompt("Explain this R error in simple terms with examples:") # Check current active prompt ai_prompt() # Clear the system prompt ai_prompt(NULL) ## End(Not run)## Not run: # Set a predefined prompt ai_prompt("debugging") # Set a custom prompt ai_prompt("Explain this R error in simple terms with examples:") # Check current active prompt ai_prompt() # Clear the system prompt ai_prompt(NULL) ## End(Not run)
Returns the currently active system-level prompt, if any.
ai_prompt_active()ai_prompt_active()
The active prompt text, or NULL if no system prompt is set.
## Not run: # Check current active prompt ai_prompt_active() ## End(Not run)## Not run: # Check current active prompt ai_prompt_active() ## End(Not run)
Clears the currently active system-level prompt.
ai_prompt_clear()ai_prompt_clear()
Invisibly returns NULL.
## Not run: # Clear the system prompt ai_prompt_clear() ## End(Not run)## Not run: # Clear the system prompt ai_prompt_clear() ## End(Not run)
Lists all available prompts in the prompt library.
ai_prompt_list()ai_prompt_list()
A named list of available prompts.
## Not run: # List all available prompts ai_prompt_list() ## End(Not run)## Not run: # List all available prompts ai_prompt_list() ## End(Not run)
A set of functions to manage and apply prompts for AI search services. These functions allow you to create, maintain, and use a library of effective prompts for different AI assistants and scenarios.
The prompt management system works with multiple levels of prompts:
System-level prompt: Set with ai_prompt(), applies across all AI services
Service-specific prompts: Set with options() or in function calls
Default prompts: Built-in prompts that ship with the package
When a search is performed, prompts are applied in this order, with the query at the end.
Adds a new prompt to the prompt library.
ai_prompt_register(name, prompt_text, overwrite = FALSE)ai_prompt_register(name, prompt_text, overwrite = FALSE)
name |
Name for the new prompt. |
prompt_text |
The prompt text to register. |
overwrite |
Whether to overwrite an existing prompt with the same name. Default is FALSE. |
Invisibly returns the updated prompt library.
## Not run: # Register a new prompt ai_prompt_register( "tidyverse", paste("As a tidyverse expert, explain how to solve this problem using", "dplyr, tidyr, and other tidyverse packages:" ) ) ## End(Not run)## Not run: # Register a new prompt ai_prompt_register( "tidyverse", paste("As a tidyverse expert, explain how to solve this problem using", "dplyr, tidyr, and other tidyverse packages:" ) ) ## End(Not run)
Removes a prompt from the prompt library.
ai_prompt_remove(name)ai_prompt_remove(name)
name |
Name of the prompt to remove. |
Invisibly returns the updated prompt library.
## Not run: # Remove a prompt ai_prompt_remove("tidyverse") ## End(Not run)## Not run: # Remove a prompt ai_prompt_remove("tidyverse") ## End(Not run)
Searches Microsoft Bing Copilot, which combines web search results with AI-generated responses. This makes it useful for queries that benefit from current web information.
ask_bing_copilot(query = geterrmessage(), prompt = NULL) ask_copilot(query = geterrmessage(), prompt = NULL)ask_bing_copilot(query = geterrmessage(), prompt = NULL) ask_copilot(query = geterrmessage(), prompt = NULL)
query |
Contents of string to send to AI Service. Default is the last error message. |
prompt |
Optional prompt prefix to add before your query to guide how the AI Service responds. If NULL, uses the service-specific default prompt option. |
The generated search URL or an empty string.
Other AI assistants:
ask_chatgpt(),
ask_claude(),
ask_grok(),
ask_meta_ai(),
ask_mistral(),
ask_perplexity()
# Basic query ask_bing_copilot("Latest R package for geospatial analysis") # Using a custom prompt ask_bing_copilot("Write a function to calculate the median", prompt = "Show multiple approaches:")# Basic query ask_bing_copilot("Latest R package for geospatial analysis") # Using a custom prompt ask_bing_copilot("Write a function to calculate the median", prompt = "Show multiple approaches:")
Opens a browser with OpenAI's ChatGPT interface and your query. This function allows you to ask questions, get code help, or search for information using ChatGPT.
ask_chatgpt(query = geterrmessage(), prompt = NULL)ask_chatgpt(query = geterrmessage(), prompt = NULL)
query |
Contents of string to send to AI Service. Default is the last error message. |
prompt |
Optional prompt prefix to add before your query to guide how the AI Service responds. If NULL, uses the service-specific default prompt option. |
The generated search URL or an empty string.
Other AI assistants:
ask_bing_copilot(),
ask_claude(),
ask_grok(),
ask_meta_ai(),
ask_mistral(),
ask_perplexity()
# Basic query ask_chatgpt("How to join two dataframes in R?") # Using a custom prompt ask_chatgpt("Error: object 'mtcrs' not found", prompt = "Debug this error step by step:") # Searching the last error ## Not run: tryCatch( median("not a number"), error = function(e) ask_chatgpt() ) ## End(Not run)# Basic query ask_chatgpt("How to join two dataframes in R?") # Using a custom prompt ask_chatgpt("Error: object 'mtcrs' not found", prompt = "Debug this error step by step:") # Searching the last error ## Not run: tryCatch( median("not a number"), error = function(e) ask_chatgpt() ) ## End(Not run)
Opens Anthropic's Claude AI assistant with your query. Claude can provide thorough answers to complex questions and offers excellent code explanations.
ask_claude(query = geterrmessage(), prompt = NULL)ask_claude(query = geterrmessage(), prompt = NULL)
query |
Contents of string to send to AI Service. Default is the last error message. |
prompt |
Optional prompt prefix to add before your query to guide how the AI Service responds. If NULL, uses the service-specific default prompt option. |
The generated search URL or an empty string.
Other AI assistants:
ask_bing_copilot(),
ask_chatgpt(),
ask_grok(),
ask_meta_ai(),
ask_mistral(),
ask_perplexity()
# Basic query ask_claude("Explain what purrr::map_df does") # Using a custom prompt ask_claude("Compare tidyr::pivot_wider vs tidyr::spread", prompt = "Provide examples of when to use each:")# Basic query ask_claude("Explain what purrr::map_df does") # Using a custom prompt ask_claude("Compare tidyr::pivot_wider vs tidyr::spread", prompt = "Provide examples of when to use each:")
Searches xAI's Grok, which provides AI assistance focused on maximize truth and objectivity.
ask_grok(query = geterrmessage(), prompt = NULL) ask_xai(query = geterrmessage(), prompt = NULL)ask_grok(query = geterrmessage(), prompt = NULL) ask_xai(query = geterrmessage(), prompt = NULL)
query |
Contents of string to send to AI Service. Default is the last error message. |
prompt |
Optional prompt prefix to add before your query to guide how the AI Service responds. If NULL, uses the service-specific default prompt option. |
The generated search URL or an empty string.
Other AI assistants:
ask_bing_copilot(),
ask_chatgpt(),
ask_claude(),
ask_meta_ai(),
ask_mistral(),
ask_perplexity()
# Basic query ask_grok("What are the best practices for R package development?") # Using a custom prompt ask_grok("How to optimize this R code for performance?", prompt = "Focus on efficiency and best practices:")# Basic query ask_grok("What are the best practices for R package development?") # Using a custom prompt ask_grok("How to optimize this R code for performance?", prompt = "Focus on efficiency and best practices:")
Searches Meta AI, which provides general-purpose AI assistance with a focus on conversational responses.
ask_meta_ai(query = geterrmessage(), prompt = NULL)ask_meta_ai(query = geterrmessage(), prompt = NULL)
query |
Contents of string to send to AI Service. Default is the last error message. |
prompt |
Optional prompt prefix to add before your query to guide how the AI Service responds. If NULL, uses the service-specific default prompt option. |
The generated search URL or an empty string.
Other AI assistants:
ask_bing_copilot(),
ask_chatgpt(),
ask_claude(),
ask_grok(),
ask_mistral(),
ask_perplexity()
# Basic query ask_meta_ai("What are the best R packages for visualization?") # Using a custom prompt ask_meta_ai("How to create a heatmap in R", prompt = "Compare ggplot2 and base R approaches:")# Basic query ask_meta_ai("What are the best R packages for visualization?") # Using a custom prompt ask_meta_ai("How to create a heatmap in R", prompt = "Compare ggplot2 and base R approaches:")
Launches Mistral AI with your query. Mistral is known for its strong reasoning capabilities and efficiency.
ask_mistral(query = geterrmessage(), prompt = NULL) ask_le_chat(query = geterrmessage(), prompt = NULL)ask_mistral(query = geterrmessage(), prompt = NULL) ask_le_chat(query = geterrmessage(), prompt = NULL)
query |
Contents of string to send to AI Service. Default is the last error message. |
prompt |
Optional prompt prefix to add before your query to guide how the AI Service responds. If NULL, uses the service-specific default prompt option. |
The generated search URL or an empty string.
Other AI assistants:
ask_bing_copilot(),
ask_chatgpt(),
ask_claude(),
ask_grok(),
ask_meta_ai(),
ask_perplexity()
# Basic query ask_mistral("How to handle missing data in R?") # Using a custom prompt ask_mistral("Fix this code: ggplot(mtcars, aes(x=mpg, y=hp) + geom_point()", prompt = "Explain the error and fix it:")# Basic query ask_mistral("How to handle missing data in R?") # Using a custom prompt ask_mistral("Fix this code: ggplot(mtcars, aes(x=mpg, y=hp) + geom_point()", prompt = "Explain the error and fix it:")
Searches with Perplexity AI, which provides answers with citations to sources. This makes it particularly useful for research-oriented queries.
ask_perplexity(query = geterrmessage(), prompt = NULL)ask_perplexity(query = geterrmessage(), prompt = NULL)
query |
Contents of string to send to AI Service. Default is the last error message. |
prompt |
Optional prompt prefix to add before your query to guide how the AI Service responds. If NULL, uses the service-specific default prompt option. |
The generated search URL or an empty string.
Other AI assistants:
ask_bing_copilot(),
ask_chatgpt(),
ask_claude(),
ask_grok(),
ask_meta_ai(),
ask_mistral()
# Basic query ask_perplexity("Compare dplyr vs data.table") # Using a custom prompt ask_perplexity("Best packages for time series in R", prompt = "Provide citations and compare performance:")# Basic query ask_perplexity("Compare dplyr vs data.table") # Using a custom prompt ask_perplexity("Best packages for time series in R", prompt = "Provide citations and compare performance:")
The search_bing() function searches Bing using:
https://www.bing.com/search?q=<query>
search_bing(query = geterrmessage(), rlang = TRUE)search_bing(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
The generated search URL or an empty string.
Other search engines:
search_brave(),
search_duckduckgo(),
search_ecosia(),
search_google(),
search_kagi(),
search_qwant(),
search_rseek(),
search_startpage()
# Search Bing search_bing("Microsoft R")# Search Bing search_bing("Microsoft R")
The search_bitbucket() and search_bb() functions both search
BitBucket using:
https://bitbucket.org/search?q=lang\%3Ar+<query>
search_bitbucket(query = geterrmessage(), rlang = TRUE) search_bb(query = geterrmessage(), rlang = TRUE)search_bitbucket(query = geterrmessage(), rlang = TRUE) search_bb(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
For additional details regarding BitBucket's search interface please see: https://confluence.atlassian.com/bitbucket/code-search-in-bitbucket-873876782.html
The generated search URL or an empty string.
Other code repositories:
search_github(),
search_grep()
# Search BitBucket for assertions search_bitbucket("assertions") # Search all languages on BitBucket for assertions search_bitbucket("assertions", rlang = FALSE)# Search BitBucket for assertions search_bitbucket("assertions") # Search all languages on BitBucket for assertions search_bitbucket("assertions", rlang = FALSE)
The search_bluesky() functions search
BlueSky using: https://bsky.app/search?q=%23rstats+<query>
search_bluesky(query = geterrmessage(), rlang = TRUE)search_bluesky(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
The generated search URL or an empty string.
Other community sites:
search_mastodon(),
search_posit_community(),
search_stackoverflow(),
search_twitter()
# Search BlueSky search_bluesky("searcher")# Search BlueSky search_bluesky("searcher")
The search_brave() function searches
Brave using: https://search.brave.com/search?q=<query>&source=web
search_brave(query = geterrmessage(), rlang = TRUE)search_brave(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
The generated search URL or an empty string.
Other search engines:
search_bing(),
search_duckduckgo(),
search_ecosia(),
search_google(),
search_kagi(),
search_qwant(),
search_rseek(),
search_startpage()
# Search Brave search_brave("webR")# Search Brave search_brave("webR")
The search_duckduckgo() and search_ddg() functions both search
DuckDuckGo using: https://duckduckgo.com/?q=<query>
search_duckduckgo(query = geterrmessage(), rlang = TRUE) search_ddg(query = geterrmessage(), rlang = TRUE)search_duckduckgo(query = geterrmessage(), rlang = TRUE) search_ddg(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
The generated search URL or an empty string.
Other search engines:
search_bing(),
search_brave(),
search_ecosia(),
search_google(),
search_kagi(),
search_qwant(),
search_rseek(),
search_startpage()
# Search DuckDuckGo search_duckduckgo("R language")# Search DuckDuckGo search_duckduckgo("R language")
The search_ecosia() function searches
Ecosia using: https://www.ecosia.org/search?q=<query>
search_ecosia(query = geterrmessage(), rlang = TRUE)search_ecosia(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
For additional details regarding Ecosia's search interface please see: https://support.ecosia.org/article/657-installing-ecosia-on-your-desktop-device
The generated search URL or an empty string.
Other search engines:
search_bing(),
search_brave(),
search_duckduckgo(),
search_google(),
search_kagi(),
search_qwant(),
search_rseek(),
search_startpage()
# Search Ecosia search_ecosia("climate change R analysis")# Search Ecosia search_ecosia("climate change R analysis")
The search_github() and search_gh() functions both search
GitHub using:
https://github.com/search?q=<query>+language\%3Ar+type\%3Aissue&type=Issues
search_github(query = geterrmessage(), rlang = TRUE) search_gh(query = geterrmessage(), rlang = TRUE)search_github(query = geterrmessage(), rlang = TRUE) search_gh(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
For additional details regarding GitHub's search interface please see: https://docs.github.com/en/enterprise-cloud@latest/search-github/getting-started-with-searching-on-github/about-searching-on-github and https://docs.github.com/en/search-github/searching-on-github/searching-code/
The generated search URL or an empty string.
Other code repositories:
search_bitbucket(),
search_grep()
# Search GitHub Issues for bivariate normal in the language:r search_github("bivariate normal") # Search all languages on GitHub Issues for bivariate normal search_github("bivariate normal", rlang = FALSE)# Search GitHub Issues for bivariate normal in the language:r search_github("bivariate normal") # Search all languages on GitHub Issues for bivariate normal search_github("bivariate normal", rlang = FALSE)
The search_google function searches Google using:
https://www.google.com/search?q=<query>
search_google(query = geterrmessage(), rlang = TRUE)search_google(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
The generated search URL or an empty string.
Other search engines:
search_bing(),
search_brave(),
search_duckduckgo(),
search_ecosia(),
search_kagi(),
search_qwant(),
search_rseek(),
search_startpage()
# Search Google search_google("r-project") ## Not run: # On error, automatically search the message on google options(error = searcher("google")) options(error = search_google) ## End(Not run)# Search Google search_google("r-project") ## Not run: # On error, automatically search the message on google options(error = searcher("google")) options(error = search_google) ## End(Not run)
The search_grep() function searches all public code on
GitHub using grep.app by
querying: https://grep.app/search?q=<query-here>&filter[lang][0]=R
search_grep(query = geterrmessage(), rlang = TRUE)search_grep(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
The generated search URL or an empty string.
Other code repositories:
search_bitbucket(),
search_github()
# Search R code on GitHub for numerical optimization search_grep("optim") # Search all code on GitHub for numerical optimization search_grep("optim", rlang = FALSE)# Search R code on GitHub for numerical optimization search_grep("optim") # Search all code on GitHub for numerical optimization search_grep("optim", rlang = FALSE)
The search_kagi() function searches
Kagi using: https://kagi.com/search?q=<query>
search_kagi(query = geterrmessage(), rlang = TRUE)search_kagi(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
This is a paid search engine, and you will need to sign up for an account to use it.
The generated search URL or an empty string.
Other search engines:
search_bing(),
search_brave(),
search_duckduckgo(),
search_ecosia(),
search_google(),
search_qwant(),
search_rseek(),
search_startpage()
# Search Kagi search_kagi("advanced R programming")# Search Kagi search_kagi("advanced R programming")
The search_mastodon() functions search
Mastodon using: https://mastodon.social/search?q=%23rstats+<query>
search_mastodon(query = geterrmessage(), rlang = TRUE)search_mastodon(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
The generated search URL or an empty string.
Other community sites:
search_bluesky(),
search_posit_community(),
search_stackoverflow(),
search_twitter()
# Search Mastodon search_mastodon("searcher")# Search Mastodon search_mastodon("searcher")
The search_posit_community() and search_posit() functions both search
Posit Community using:
https://forum.posit.co/search?q=<query>
search_posit_community(query = geterrmessage(), rlang = TRUE) search_posit(query = geterrmessage(), rlang = TRUE)search_posit_community(query = geterrmessage(), rlang = TRUE) search_posit(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
For additional details regarding Posit Community's search interface please see the Discourse API documentation: https://docs.discourse.org/#tag/Search
The generated search URL or an empty string.
Other community sites:
search_bluesky(),
search_mastodon(),
search_stackoverflow(),
search_twitter()
# Search Posit Community search_posit_community("RStudio IDE")# Search Posit Community search_posit_community("RStudio IDE")
The search_qwant() function searches
Qwant using: https://www.qwant.com/?q=<query>
search_qwant(query = geterrmessage(), rlang = TRUE)search_qwant(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
The generated search URL or an empty string.
Other search engines:
search_bing(),
search_brave(),
search_duckduckgo(),
search_ecosia(),
search_google(),
search_kagi(),
search_rseek(),
search_startpage()
# Search Qwant search_qwant("Quarto")# Search Qwant search_qwant("Quarto")
The search_rseek() function searches Rseek using:
https://rseek.org/?q=<query>
search_rseek(query = geterrmessage(), rlang = TRUE)search_rseek(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
The generated search URL or an empty string.
Other search engines:
search_bing(),
search_brave(),
search_duckduckgo(),
search_ecosia(),
search_google(),
search_kagi(),
search_qwant(),
search_startpage()
# Search Rseek search_rseek("searcher")# Search Rseek search_rseek("searcher")
Creates an appropriate query string for a search engine and then opens up the resulting page in a web browser.
search_site( query, site = c("google", "bing", "duckduckgo", "ddg", "startpage", "sp", "qwant", "rseek", "brave", "kagi", "posit community", "posit", "twitter", "x", "bluesky", "mastodon", "stackoverflow", "so", "github", "gh", "grep", "bitbucket", "bb", "chatgpt", "claude", "perplexity", "mistral", "bing copilot", "copilot", "grok", "meta ai", "meta"), rlang = TRUE, prompt = NULL )search_site( query, site = c("google", "bing", "duckduckgo", "ddg", "startpage", "sp", "qwant", "rseek", "brave", "kagi", "posit community", "posit", "twitter", "x", "bluesky", "mastodon", "stackoverflow", "so", "github", "gh", "grep", "bitbucket", "bb", "chatgpt", "claude", "perplexity", "mistral", "bing copilot", "copilot", "grok", "meta ai", "meta"), rlang = TRUE, prompt = NULL )
query |
Contents of string to search. Default is the error message. |
site |
Name of site to search on. Supported options:
|
rlang |
Search for results written in R. Default is |
prompt |
Optional prompt prefix to add before your query to guide how the AI
responds. If |
The generated search URL or an empty string.
# Search in a generic way search_site("r-project", "google")# Search in a generic way search_site("r-project", "google")
The search_stackoverflow() and search_so() functions both search
StackOverflow using:
https://stackoverflow.com/search?q=\%5Br\%5D+<query>
search_stackoverflow(query = geterrmessage(), rlang = TRUE) search_so(query = geterrmessage(), rlang = TRUE)search_stackoverflow(query = geterrmessage(), rlang = TRUE) search_so(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
For additional details regarding StackOverflow's search interface please see:
https://stackoverflow.com/help/searching
The generated search URL or an empty string.
Other community sites:
search_bluesky(),
search_mastodon(),
search_posit_community(),
search_twitter()
# Search StackOverflow for Convolutions in the r tag search_stackoverflow("convolutions") # Search all languages on StackOverflow for convolutions search_stackoverflow("convolutions", rlang = FALSE)# Search StackOverflow for Convolutions in the r tag search_stackoverflow("convolutions") # Search all languages on StackOverflow for convolutions search_stackoverflow("convolutions", rlang = FALSE)
The search_startpage() function searches
startpage using:
https://startpage.com/do/dsearch?query=<query>
search_startpage(query = geterrmessage(), rlang = TRUE) search_sp(query = geterrmessage(), rlang = TRUE)search_startpage(query = geterrmessage(), rlang = TRUE) search_sp(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
The generated search URL or an empty string.
Other search engines:
search_bing(),
search_brave(),
search_duckduckgo(),
search_ecosia(),
search_google(),
search_kagi(),
search_qwant(),
search_rseek()
# Search startpage search_startpage("VS Code")# Search startpage search_startpage("VS Code")
The search_twitter() functions search
Twitter using: https://twitter.com/search?q=<query>
search_twitter(query = geterrmessage(), rlang = TRUE) search_x(query = geterrmessage(), rlang = TRUE)search_twitter(query = geterrmessage(), rlang = TRUE) search_x(query = geterrmessage(), rlang = TRUE)
query |
Contents of string to search. Default is the error message. |
rlang |
Search for results written in R. Default is |
For additional details regarding Twitter's search interface please see: https://help.x.com/en/using-x/x-advanced-search
The generated search URL or an empty string.
Other community sites:
search_bluesky(),
search_mastodon(),
search_posit_community(),
search_stackoverflow()
# Search Twitter search_twitter("searcher")# Search Twitter search_twitter("searcher")
Constructs a function object that will search the last R error message on search portals by opening a browser.
searcher(site, keyword = getOption("searcher.default_keyword"))searcher(site, keyword = getOption("searcher.default_keyword"))
site |
Name of site to search on. Supported options:
|
keyword |
Opt to search under different default terms. |
This function acts as a closure. Thus, you will receive
a function back when only specifying the site parameter.
To call the function, add a second set of parentheses.
The searcher function grabs the last error message and
tries to search it. This function will ensure that R language
is the primary search context.
### Manually searcher("google")() ## Not run: ### Automatically # On error, automatically search the message on google options(error = searcher("google")) ## End(Not run)### Manually searcher("google")() ## Not run: ### Automatically # On error, automatically search the message on google options(error = searcher("google")) ## End(Not run)
searcher
Functions listed below are no longer included in the searcher package
search_ixquick(): The function binding was removed as the search engine
name changed to "Startpage". Please use search_startpage().
search_rstudio_community(): The function binding was removed as the
company name changed to "Posit". Please use search_posit_community().
search_rscom(): The function binding was removed as the
company name changed to "Posit". Please use search_posit().