{"id":13401220,"url":"https://github.com/coatless-rpkg/searcher","last_synced_at":"2025-12-12T01:03:49.784Z","repository":{"id":52913704,"uuid":"105853247","full_name":"coatless-rpkg/searcher","owner":"coatless-rpkg","description":"Query Search Portals and AI Assistants from R","archived":false,"fork":false,"pushed_at":"2025-05-27T19:18:46.000Z","size":3833,"stargazers_count":81,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-25T21:33:19.758Z","etag":null,"topics":["automatic","error-handling","error-messages","r","search-engine","search-portals"],"latest_commit_sha":null,"homepage":"https://r-pkg.thecoatlessprofessor.com/searcher/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coatless-rpkg.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["coatless"],"patreon":"coatless","buy_me_a_coffee":"coatless","thanks_dev":"u/gh/coatless","custom":null}},"created_at":"2017-10-05T05:36:32.000Z","updated_at":"2025-10-06T09:22:37.000Z","dependencies_parsed_at":"2024-01-18T11:04:10.474Z","dependency_job_id":"ab521976-851f-4307-b3ec-ff0372a03f7e","html_url":"https://github.com/coatless-rpkg/searcher","commit_stats":{"total_commits":56,"total_committers":4,"mean_commits":14.0,"dds":0.6071428571428572,"last_synced_commit":"89ad77e5a21f513396a6d661056aa82da65c9ac7"},"previous_names":["r-assist/searcher"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/coatless-rpkg/searcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Fsearcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Fsearcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Fsearcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Fsearcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coatless-rpkg","download_url":"https://codeload.github.com/coatless-rpkg/searcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coatless-rpkg%2Fsearcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27673719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-11T02:00:11.302Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automatic","error-handling","error-messages","r","search-engine","search-portals"],"created_at":"2024-07-30T19:01:00.029Z","updated_at":"2025-12-12T01:03:49.740Z","avatar_url":"https://github.com/coatless-rpkg.png","language":"R","funding_links":["https://github.com/sponsors/coatless","https://patreon.com/coatless","https://buymeacoffee.com/coatless","https://thanks.dev/u/gh/coatless"],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n# searcher\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/coatless-rpkg/searcher/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/coatless-rpkg/searcher/actions/workflows/R-CMD-check.yaml)\n[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/searcher)](https://www.r-pkg.org/pkg/searcher)\n[![CRAN\\_Status\\_Badge](https://www.r-pkg.org/badges/version/searcher)](https://cran.r-project.org/package=searcher)\n\u003c!-- badges: end --\u003e\n\nThe goal of `searcher` is to provide a search interface directly inside of _R_.\nFor example, to look up  `rcpp example numeric vector` \nor `ggplot2 fix axis labels` call one of the `search_*()` functions to\nautomatically have a web browser open, go to a search site, and type the query. \nBy default, the search functions will attempt to search the last error on call \nif no query is specified.\n\n![](https://i.imgur.com/Zq2rg6G.gif)\n\n## Installation\n\nThe `searcher` package is available on both \n[CRAN](https://CRAN.R-project.org/package=searcher) and \n[GitHub](https://github.com/coatless-rpkg/searcher). The \n[CRAN](https://CRAN.R-project.org/package=searcher)\nversion is considered stable while the [GitHub](https://github.com/coatless-rpkg/searcher) \nversion is in a state of development and may break. \n\nYou can install the stable version of the `searcher` package with:\n\n```r\ninstall.packages(\"searcher\")\n```\n\nFor the development version, you can opt for:\n\n```r\nif(!requireNamespace(\"remotes\")) { install.packages(\"remotes\") }\nremotes::install_github(\"coatless-rpkg/searcher\")\n```\n\n## Usage\n\n```r\nlibrary(searcher)\n```\n\n## Search Terms\n\nThe `search_*()` functions can be used to search a query directly from _R_ on\nmajor search engines, programming help websites, and code repositories. The following search\nplatforms are supported: [Google](https://www.google.com), [Bing](https://www.bing.com/),\n[DuckDuckGo](https://duckduckgo.com/), [Startpage](https://www.startpage.com/en/),\nEcosia, [rseek](https://rseek.org/), Qwant, X (formerly Twitter), [StackOverflow](https://stackoverflow.com/), \n[RStudio Community](https://community.rstudio.com/search), \n[GitHub](https://github.com/search), [grep.app](https://grep.app/), \nand [BitBucket](https://bitbucket.org/product/).\nBy default, an appropriate suffix for each platform that ensures relevant \nresults to _R_ is appended to all queries. This behavior can be disabled by \nusing `rlang = FALSE`.\n\n```r\n# Searching R project on major search engines\nsearch_google(\"R project\")\nsearch_bing(\"R project\")\nsearch_ecosia(\"R project\")\nsearch_rseek(\"R project\")\nsearch_qwant(\"R project\")\nsearch_duckduckgo(\"R project\")                           # or search_ddg(...)\nsearch_startpage(\"R project\")                            # or search_sp(...)\n\n# Searching Twitter to find out about machine learning for R and in general\nsearch_twitter(\"machine learning\")\nsearch_twitter(\"machine learning\", rlang = FALSE)\n\n# Searching for linear regression questions for R and in general\nsearch_stackoverflow(\"linear regression\")\nsearch_stackoverflow(\"linear regression\", rlang = FALSE) # or search_so(...)\n\n# Searching RStudio Community for tips\nsearch_rstudio_community(\"tips\")\nsearch_rstudio_community(\"tips\", rlang = FALSE)          # or search_rscom(...)\n\n# Searching GitHub code for graphs in R and other languages\nsearch_grep(\"graph\")\nsearch_grep(\"graph\", rlang = FALSE)\n\n# Searching GitHub Issues for maps in R and other languages\nsearch_github(\"maps\")\nsearch_github(\"maps\", rlang = FALSE)                     # or search_gh(...)\n\n# Searching BitBucket for assertions in R and other languages\nsearch_bitbucket(\"assertions\")\nsearch_bitbucket(\"assertions\", rlang = FALSE)            # or search_bb(...)\n```\n\n## Search Errors\n\n`searcher` offers preliminary support for automatically or manually \nsearching errors that are generated in _R_. For more robust error search\nsupport and to also search warning messages, please use the\n[`errorist`](https://github.com/coatless-rpkg/errorist) package.\n\n### Automatically \n\nSearching the last error automatically is possible by registering a function\nas _R_'s error handler via either `searcher(site=\"\")` or one of the `search_*()`\nfunctions.  Thus, when an error occurs, this function will automatically be called. This \ntriggers a new browser window to open with the error term listed in verbatim.\n\n```r\n# Using the generic search error handler\noptions(error = searcher(\"google\"))\n\n# Directly specify the search function\noptions(error = search_github)\noptions(error = search_google)\n```\n\n### Manually\n\nAlternatively, these functions can also be used manually so that the default\nerror dispatch is preserved. In the manual case, you will have to explicitly\ncall the search function. After that, a browser window will open with\nthe last error message as the search query on the desired search portal.\n\n```r\nsearch_google()\nsearch_bing()\nsearch_ecosia()\nsearch_rseek()\nsearch_qwant()\nsearch_twitter()\nsearch_grep()\nsearch_duckduckgo()        # or search_ddg()\nsearch_startpage()         # or search_sp()\nsearch_stackoverflow()     # or search_so()\nsearch_rstudio_community() # or search_rscom()\nsearch_github()            # or search_gh()\nsearch_bitbucket()         # or search_bb()\n```\n\n## Package Customizations\n\nThe ability to customize different operations in `searcher` is possible by\nsetting values in [`options()`](https://stat.ethz.ch/R-manual/R-patched/RHOME/library/base/html/options.html)\nwithin [`~/.Rprofile`](https://stat.ethz.ch/R-manual/R-patched/library/base/html/Startup.html).\nPresently, the following options are available:\n\n- `searcher.launch_delay`: Amount of time between launching the web browser\n  from when the command was issued. Default is `0.5` seconds.\n- `searcher.use_rstudio_viewer`: Display search results in the RStudio\n   viewer pane instead of a web browser. Default is `FALSE`.\n- `searcher.default_keyword`: Suffix keyword to focus search results\n  between either `\"base\"` or `\"tidyverse\"`. Default is `\"base\"`.\n\nTo set one of these options, please create the `.Rprofile` by typing into _R_:\n\n```r\nfile.edit(\"~/.Rprofile\")\n```\n\nFrom there, add:\n\n```r\n.First = function() {\n  options(\n    searcher.launch_delay       = 0,\n    searcher.use_rstudio_viewer = FALSE,\n    searcher.default_keyword    = \"tidyverse\"\n    ## Additional options.\n  )\n}\n```\n\n## Motivation\n\nThe idea for `searcher` began as a project to automatically search errors and\nwarnings that occurred while working with _R_ after a conversation \namong [Dirk Eddelbuettel](http://dirk.eddelbuettel.com), \n[Barry Rowlingson](http://barry.rowlingson.com), and myself. However, there was \nno search interface that allowed querying directly from _R_ outside of the built-in [`utils::RSiteSearch()`](https://stat.ethz.ch/R-manual/R-devel/library/utils/html/RSiteSearch.html),\nwhich only queries \u003chttp://search.r-project.org/\u003e, and the\n[`sos`](https://cran.r-project.org/package=sos) \npackage, which queries an off-site user premade database. Both of these options\nwere focused solely on querying _R_ documentation made available by packages.\nGiven the nature of errors generally being _undocumented_, neither of these\napproaches could be used. Thus, `searcher` was unintentionally born to\nprovide a means for [`errorist`](https://github.com/coatless-rpkg/errorist), which\ncontains a robust way to automatically searching errors and warnings.\n\n### Special Thanks\n\n- [Dirk Eddelbuettel](http://dirk.eddelbuettel.com) for starting the discussion\n  on [XKCD Comic 1185: Ineffective Sorts](https://xkcd.com/1185/).\n- [Barry Rowlingson](http://barry.rowlingson.com) for remarks about functionality.\n\n### Publicity\n\nOn the `#rstats`-twitter verse (c.f. `https://twitter.com/search?q=%23rstats`), `searcher` has been positively received by\ncommunity members.\n\n\u003e R package \"searcher\" that automatically searches Stackoverflow for error that\n\u003e you just saw in the console. Cool package, especially for those who learn R :)\n\u003e https://github.com/coatless-rpkg/searcher ... #r #rlang #rstats #rstudio\n\u003e\n\u003e --- Paweł Przytuła \n\u003e March 23th, 2019. ~292 Retweets and 876 likes (Note, URL updated to new repository location.)\n\n\u003e Did you know, using \"searcher\" package, you could automatically to\n\u003e search stackoverflow, google, GitHub and many more sites for errors,\n\u003e packages or topics. #rstats\n\u003e\n\u003e --- Shakirah Nakalungi (c.f. `https://twitter.com/cynthia_kyra`) June 29th, 2019, when she was Rotating Curator for the \"We are R-Ladies\" twitter account (c.f. `https://twitter.com/WeAreRLadies/status/1144921174251581440`)\n\u003e ~144 Retweets and 544 likes\n\nPlease let us know via an [issue ticket](https://github.com/coatless-rpkg/searcher/issues/new)\nabout how you are using `searcher`.\n\n## License\n\nGPL (\u003e= 2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoatless-rpkg%2Fsearcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoatless-rpkg%2Fsearcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoatless-rpkg%2Fsearcher/lists"}