From c55116ec03014483f4643b47ff9d14f774246a8b Mon Sep 17 00:00:00 2001 From: coatless Date: Tue, 14 Nov 2023 00:55:16 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20coatless?= =?UTF-8?q?-rpkg/searcher@e1edd2633eed2d383e7ef38b98cb1813287177dc=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .nojekyll | 1 + 404.html | 115 ++++++++++ articles/index.html | 86 +++++++ articles/search-patterns.html | 246 ++++++++++++++++++++ authors.html | 112 ++++++++++ bootstrap-toc.css | 60 +++++ bootstrap-toc.js | 159 +++++++++++++ docsearch.css | 148 ++++++++++++ docsearch.js | 85 +++++++ index.html | 297 ++++++++++++++++++++++++ link.svg | 12 + news/index.html | 215 ++++++++++++++++++ pkgdown.css | 384 ++++++++++++++++++++++++++++++++ pkgdown.js | 108 +++++++++ pkgdown.yml | 10 + reference/Rplot001.png | Bin 0 -> 1011 bytes reference/index.html | 103 +++++++++ reference/search_site.html | 349 +++++++++++++++++++++++++++++ reference/searcher-defunct.html | 96 ++++++++ reference/searcher-package.html | 116 ++++++++++ reference/searcher.html | 138 ++++++++++++ sitemap.xml | 36 +++ 22 files changed, 2876 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 articles/index.html create mode 100644 articles/search-patterns.html create mode 100644 authors.html create mode 100644 bootstrap-toc.css create mode 100644 bootstrap-toc.js create mode 100644 docsearch.css create mode 100644 docsearch.js create mode 100644 index.html create mode 100644 link.svg create mode 100644 news/index.html create mode 100644 pkgdown.css create mode 100644 pkgdown.js create mode 100644 pkgdown.yml create mode 100644 reference/Rplot001.png create mode 100644 reference/index.html create mode 100644 reference/search_site.html create mode 100644 reference/searcher-defunct.html create mode 100644 reference/searcher-package.html create mode 100644 reference/searcher.html create mode 100644 sitemap.xml diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.nojekyll @@ -0,0 +1 @@ + diff --git a/404.html b/404.html new file mode 100644 index 0000000..ecd9cd9 --- /dev/null +++ b/404.html @@ -0,0 +1,115 @@ + + + + + + + +Page not found (404) • searcher + + + + + + + + + + + +
+
+ + + + +
+
+ + +Content not found. Please use links in the navbar. + +
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/index.html b/articles/index.html new file mode 100644 index 0000000..05aa514 --- /dev/null +++ b/articles/index.html @@ -0,0 +1,86 @@ + +Articles • searcher + + +
+
+ + + +
+
+ + +
+

All vignettes

+

+ +
Search Patterns
+
+
+
+
+ + +
+ + + + + + + + diff --git a/articles/search-patterns.html b/articles/search-patterns.html new file mode 100644 index 0000000..f0d5f27 --- /dev/null +++ b/articles/search-patterns.html @@ -0,0 +1,246 @@ + + + + + + + +Search Patterns • searcher + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +
+

Introduction +

+

When trying to solve a problem, part of the process is to research +what attempts have been made by others. The most common form of research +is to query a search portal. One downside to this +approach is that each search portal has its own set of operators or +query phrasing that will yield relevant content. As a result, those that +have domain knowledge are able to format the search query in a way that +is better. Still many queries are not constrained enough to the +programming language being used. The goal of searcher is to +attempt to address both needs by providing a convenient pre-specified +search interface that tailors the results to R.

+
+
+

Usage +

+

To begin using searcher, first install the package from +CRAN.

+
+# Install the searcher package if not already installed
+install.packages("searcher")
+

Once installed, searching with searcher is done by using +one or more of the search_*() functions. To access these +functions, either use a namespace function call of +searcher::search_*() or load the searcher +package and, then, call the function.

+
+# Loads the searcher package
+library("searcher")
+
+# Searches using Google for `tips`
+search_google("tips")
+
+
+

Search Operators +

+

Within the searcher package, each +search_*() function has the parameter of +rlang = TRUE. By default, this enforces a search that +guarantees R-specific results. If rlang = FALSE, +then the results are generalized.

+
    +
  • Search Engines +
      +
    • All search engines affix "r programming" to the end of +the query to constrain the results to be R-specific.
    • +
    • +"r programming" was selected because it performed best +when compared to "rlang", "rstats", and +"r language" on Google Trends.
    • +
    +
  • +
  • Community Sites + +
  • +
  • Code Repositories + +
  • +
+
+
+

General Search Tips +

+

To improve your R-related search query, it has been +suggested to use:

+
    +
  • +"r how to do <x>" +
      +
    • "r how to remove legends in ggplot"
    • +
    • This is a baseline search query.
    • +
    +
  • +
  • +"<package name> <problem>" +
      +
    • "ggplot2 fix x-axis labels."
    • +
    • If the package is R-specific, it may help dropping +r and instead focusing on the package name at the start of +the query.
    • +
    +
  • +
  • +"r <package-name> <problem> <year> site:<specific-site> +
      +
    • "r ggplot2 center graph title 2018 site:stackoverflow.com
    • +
    • By specifying the package name, a year, and target site the +“freshest” solution will likely be found.
    • +
    +
  • +
+

Suggestions here were pooled from discussion on rOpenSci’s slack with +Steph Locke and Robert Mitchell.

+
+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/authors.html b/authors.html new file mode 100644 index 0000000..6b80b81 --- /dev/null +++ b/authors.html @@ -0,0 +1,112 @@ + +Authors and Citation • searcher + + +
+
+ + + +
+
+
+ + + +
  • +

    James Balamuta. Author, maintainer. +

    +
  • +
  • +

    Alex Rossell Hayes. Contributor. +

    +
  • +
+
+
+

Citation

+ Source: DESCRIPTION +
+
+ + +

Balamuta J (2023). +searcher: Query Search Interfaces. +R package version 0.0.6, https://r-pkg.thecoatlessprofessor.com/searcher/, https://github.com/coatless-rpkg/searcher. +

+
@Manual{,
+  title = {searcher: Query Search Interfaces},
+  author = {James Balamuta},
+  year = {2023},
+  note = {R package version 0.0.6, https://r-pkg.thecoatlessprofessor.com/searcher/},
+  url = {https://github.com/coatless-rpkg/searcher},
+}
+ +
+ +
+ + + +
+ + + + + + + + diff --git a/bootstrap-toc.css b/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/bootstrap-toc.js b/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docsearch.css b/docsearch.css new file mode 100644 index 0000000..e5f1fe1 --- /dev/null +++ b/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/docsearch.js b/docsearch.js new file mode 100644 index 0000000..b35504c --- /dev/null +++ b/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..6747d5c --- /dev/null +++ b/index.html @@ -0,0 +1,297 @@ + + + + + + + +Query Search Interfaces • searcher + + + + + + + + + + + + +
    +
    + + + + +
    +
    +
    + + + +

    The goal of searcher is to provide a search interface directly inside of R. For example, to look up rcpp example numeric vector or ggplot2 fix axis labels call one of the search_*() functions to automatically have a web browser open, go to a search site, and type the query. By default, the search functions will attempt to search the last error on call if no query is specified.

    +

    +
    +

    Installation +

    +

    The searcher package is available on both CRAN and GitHub. The CRAN version is considered stable while the GitHub version is in a state of development and may break.

    +

    You can install the stable version of the searcher package with:

    +
    +install.packages("searcher")
    +

    For the development version, you can opt for:

    +
    +if(!requireNamespace("remotes")) { install.packages("remotes") }
    +remotes::install_github("coatless-rpkg/searcher")
    +
    +
    +

    Usage +

    + +
    +
    +

    Search Terms +

    +

    The search_*() functions can be used to search a query directly from R on major search engines, programming help websites, and code repositories. The following search platforms are supported: Google, Bing, DuckDuckGo, Startpage, Ecosia, rseek, Twitter, StackOverflow, RStudio Community, GitHub, and BitBucket. By default, an appropriate suffix for each platform that ensures relevant results to R is appended to all queries. This behavior can be disabled by using rlang = FALSE.

    +
    +# Searching R project on major search engines
    +search_google("R project")
    +search_bing("R project")
    +search_ecosia("R project")
    +search_rseek("R project")
    +search_duckduckgo("R project")                           # or search_ddg(...)
    +search_startpage("R project")                            # or search_sp(...)
    +
    +# Searching Twitter to find out about machine learning for R and in general
    +search_twitter("machine learning")
    +search_twitter("machine learning", rlang = FALSE)
    +
    +# Searching for linear regression questions for R and in general
    +search_stackoverflow("linear regression")
    +search_stackoverflow("linear regression", rlang = FALSE) # or search_so(...)
    +
    +# Searching RStudio Community for tips
    +search_rstudio_community("tips")
    +search_rstudio_community("tips", rlang = FALSE)          # or search_rscom(...)
    +
    +# Searching GitHub Issues for maps in R and other languages
    +search_github("maps")
    +search_github("maps", rlang = FALSE)                     # or search_gh(...)
    +
    +# Searching BitBucket for assertions in R and other languages
    +search_bitbucket("assertions")
    +search_bitbucket("assertions", rlang = FALSE)            # or search_bb(...)
    +
    +
    +

    Search Errors +

    +

    searcher offers preliminary support for automatically or manually searching errors that are generated in R. For more robust error search support and to also search warning messages, please use the errorist package.

    +
    +

    Automatically +

    +

    Searching the last error automatically is possible by registering a function as R’s error handler via either searcher(site="") or one of the search_*() functions. Thus, when an error occurs, this function will automatically be called. This triggers a new browser window to open with the error term listed in verbatim.

    +
    +# Using the generic search error handler
    +options(error = searcher("google"))
    +
    +# Directly specify the search function
    +options(error = search_github)
    +options(error = search_google)
    +
    +
    +

    Manually +

    +

    Alternatively, these functions can also be used manually so that the default error dispatch is preserved. In the manual case, you will have to explicitly call the search function. After that, a browser window will open with the last error message as the search query on the desired search portal.

    +
    +search_google()
    +search_bing()
    +search_ecosia()
    +search_rseek()
    +search_twitter()
    +search_duckduckgo()        # or search_ddg()
    +search_startpage()         # or search_sp()
    +search_stackoverflow()     # or search_so()
    +search_rstudio_community() # or search_rscom()
    +search_github()            # or search_gh()
    +search_bitbucket()         # or search_bb()
    +
    +
    +
    +

    Package Customizations +

    +

    The ability to customize different operations in searcher is possible by setting values in options() within ~/.Rprofile. Presently, the following options are available:

    +
      +
    • +searcher.launch_delay: Amount of time between launching the web browser from when the command was issued. 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 focus search results between either "base" or "tidyverse". Default is "base".
    • +
    +

    To set one of these options, please create the .Rprofile by typing into R:

    +
    +file.edit("~/.Rprofile")
    +

    From there, add:

    +
    +.First = function() {
    +  options(
    +    searcher.launch_delay       = 0,
    +    searcher.use_rstudio_viewer = FALSE,
    +    searcher.default_keyword    = "tidyverse"
    +    ## Additional options.
    +  )
    +}
    +
    +
    +

    Motivation +

    +

    The idea for searcher began as a project to automatically search errors and warnings that occurred while working with R after a conversation among Dirk Eddelbuettel, Barry Rowlingson, and myself. However, there was no search interface that allowed querying directly from R outside of the built-in utils::RSiteSearch(), which only queries http://search.r-project.org/, and the sos package, which queries an off-site user premade database. Both of these options were focused solely on querying R documentation made available by packages. Given the nature of errors generally being undocumented, neither of these approaches could be used. Thus, searcher was unintentionally born to provide a means for errorist, which contains a robust way to automatically searching errors and warnings.

    +
    +

    Special Thanks +

    + +
    +
    +

    Publicity +

    +

    On the #rstats-twitter verse, searcher has been positively received by community members.

    +
    +

    R package “searcher” that automatically searches Stackoverflow for error that you just saw in the console. Cool package, especially for those who learn R :) https://github.com/coatless-rpkg/searcher … #r #rlang #rstats #rstudio

    +

    Paweł Przytuła March 23th, 2019. ~292 Retweets and 876 likes (Note, URL updated to new repository location.)

    +
    +
    +

    Did you know, using “searcher” package, you could automatically to search stackoverflow, google, GitHub and many more sites for errors, packages or topics. #rstats

    +

    Shakirah Nakalungi June 29th, 2019, when she was Rotating Curator for the “We are R-Ladies” twitter account. ~144 Retweets and 544 likes

    +
    +

    Please let us know via an issue ticket about how you are using searcher.

    +
    +
    +
    +

    License +

    +

    GPL (>= 2)

    +
    +
    +
    + + +
    + + + +
    + + + + + + + + diff --git a/link.svg b/link.svg new file mode 100644 index 0000000..88ad827 --- /dev/null +++ b/link.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/news/index.html b/news/index.html new file mode 100644 index 0000000..9d7971e --- /dev/null +++ b/news/index.html @@ -0,0 +1,215 @@ + +Changelog • searcher + + +
    +
    + + + +
    +
    + + +
    + +
    +

    Features

    +
    +
    +

    Bug Fixes

    +
    • Modified URLs to search engines to pass CRAN checks.
    • +
    • Removed documentation URLs to Ecosia search engine as they return 404: Not Found.
    • +
    +
    +

    Deployment

    +
    +
    +
    + +
    +

    Features

    +
    • Added search portal: +
    • +
    • Added ability to set default package actions. (#7, #20) +
      • +searcher.launch_delay controls how long the user remains in R prior to the browser opening. Default is 0.5 seconds.
      • +
      • +searcher.use_rstudio_viewer specifies whether RStudio’s viewer pane should open the link instead of a web browser. Default is FALSE until RStudio’s sandbox issue is resolved.
      • +
      • +searcher.default_keyword: Suffix keyword to focus search results between either "base" or "tidyverse". Default is "base".
      • +
    • +
    • Added option to launch RStudio’s Viewer pane to display search results. +
    • +
    +
    +

    Breaking Changes

    +
    • Function factory or a closure approach-based approach is now used to create search portal functions search_*() through searcher().
    • +
    • +searcher() function has lost the ability to specify rlang to address an unevaluated promise issue.
    • +
    +
    +

    Fixes

    +
    • Addressed internal vignette index name being used as the title.
    • +
    +
    +

    Deployment

    +
    +
    +
    + +
    +

    Features

    +
    +
    +

    Changes

    +
    +
    +

    Deployment

    +
    • Improved TravisCI testing deployments by testing across an array and using all CPUs allotted to build the container. (#16)
    • +
    • Modify thresholding for code coverage rejections. (#16)
    • +
    +
    +
    + +
    +

    Features

    +
    +
    +

    Changes

    +
    • Append r programming to major search engines by default (#11, #10)
    • +
    • Add ixquick as a valid engine to search_site(). (#8, #6)
    • +
    • Included link to repository and bug tracker to DESCRIPTION.
    • +
    +
    +
    + +
    +

    Features

    +
    +
    +

    UX

    +
    • Created a browse_url() that checks to see if it is in interactive mode before trying to open a web browser 0.5 seconds after call.
    • +
    +
    +
    + + + +
    + + +
    + + + + + + + + diff --git a/pkgdown.css b/pkgdown.css new file mode 100644 index 0000000..80ea5b8 --- /dev/null +++ b/pkgdown.css @@ -0,0 +1,384 @@ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + +body { + position: relative; +} + +body > .container { + display: flex; + height: 100%; + flex-direction: column; +} + +body > .container .row { + flex: 1 0 auto; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; + flex-shrink: 0; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +/* Ensure in-page images don't run outside their container */ +.contents img { + max-width: 100%; + height: auto; +} + +/* Fix bug in bootstrap (only seen in firefox) */ +summary { + display: list-item; +} + +/* Typographic tweaking ---------------------------------*/ + +.contents .page-header { + margin-top: calc(-60px + 1em); +} + +dd { + margin-left: 3em; +} + +/* Section anchors ---------------------------------*/ + +a.anchor { + display: none; + margin-left: 5px; + width: 20px; + height: 20px; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +h1:hover .anchor, +h2:hover .anchor, +h3:hover .anchor, +h4:hover .anchor, +h5:hover .anchor, +h6:hover .anchor { + display: inline-block; +} + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -40px; +} + +/* Navbar submenu --------------------------*/ + +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} + +/* Sidebar --------------------------*/ + +#pkgdown-sidebar { + margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; +} + +#pkgdown-sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#pkgdown-sidebar h2:first-child { + margin-top: 0; +} + +#pkgdown-sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + +.orcid { + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top; min-width: 100px} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre, code, pre code { + background-color: #f8f8f8; + color: #333; +} +pre, pre code { + white-space: pre-wrap; + word-break: break-all; + overflow-wrap: break-word; +} + +pre { + border: 1px solid #eee; +} + +pre .img, pre .r-plt { + margin: 5px 0; +} + +pre .img img, pre .r-plt img { + background-color: #fff; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.error {font-weight: bolder;} +.warning {font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} + +/* Section anchors --------------------------------- + Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 +*/ + +div.csl-bib-body { } +div.csl-entry { + clear: both; +} +.hanging-indent div.csl-entry { + margin-left:2em; + text-indent:-2em; +} +div.csl-left-margin { + min-width:2em; + float:left; +} +div.csl-right-inline { + margin-left:2em; + padding-left:1em; +} +div.csl-indent { + margin-left: 2em; +} diff --git a/pkgdown.js b/pkgdown.js new file mode 100644 index 0000000..6f0eee4 --- /dev/null +++ b/pkgdown.js @@ -0,0 +1,108 @@ +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $('.navbar-fixed-top').headroom(); + + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); + }); + + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + // Ignore external links + if (links[i].host !== location.host) + continue; + + var nav_path = paths(links[i].pathname); + + var length = prefix_length(nav_path, cur_path); + if (length > max_length) { + max_length = length; + pos = i; + } + } + + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); + menu_anchor.parent().addClass("active"); + menu_anchor.closest("li.dropdown").addClass("active"); + } + }); + + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + // Returns -1 if not found + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(-1); + + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 0 : -1); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } + + /* Clipboard --------------------------*/ + + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); + } + + if(ClipboardJS.isSupported()) { + $(document).ready(function() { + var copyButton = ""; + + $("div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); + + // Initialize clipboard: + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); + } + }); + + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); + }); + } +})(window.jQuery || window.$) diff --git a/pkgdown.yml b/pkgdown.yml new file mode 100644 index 0000000..d28ba38 --- /dev/null +++ b/pkgdown.yml @@ -0,0 +1,10 @@ +pandoc: 2.19.2 +pkgdown: 2.0.7 +pkgdown_sha: ~ +articles: + search-patterns: search-patterns.html +last_built: 2023-11-14T00:55Z +urls: + reference: https://r-pkg.thecoatlessprofessor.com/searcher/reference + article: https://r-pkg.thecoatlessprofessor.com/searcher/articles + diff --git a/reference/Rplot001.png b/reference/Rplot001.png new file mode 100644 index 0000000000000000000000000000000000000000..17a358060aed2a86950757bbd25c6f92c08c458f GIT binary patch literal 1011 zcmeAS@N?(olHy`uVBq!ia0y~yV0-|=9Be?5+AI5}0x7m6Z+90U4Fo@(ch>_c&H|6f zVg?3oArNM~bhqvg0|WD9PZ!6KiaBo&GBN^{G%5UFpXcEKVvd5*5Eu=C0SJK)8A6*F U7`aXvEC5;V>FVdQ&MBb@00SN#Z2$lO literal 0 HcmV?d00001 diff --git a/reference/index.html b/reference/index.html new file mode 100644 index 0000000..8f81604 --- /dev/null +++ b/reference/index.html @@ -0,0 +1,103 @@ + +Function reference • searcher + + +
    +
    + + + +
    +
    + + + + + + + + + + + +
    +

    All functions

    +

    +
    +

    search_site() search_google() search_bing() search_duckduckgo() search_ddg() search_ixquick() search_startpage() search_sp() search_ecosia() search_rseek() search_rstudio_community() search_rscom() search_twitter() search_stackoverflow() search_so() search_github() search_gh() search_bitbucket() search_bb()

    +

    Search a Query on a Search Portal in a Web Browser

    +

    searcher-defunct

    +

    Defunct functions in searcher

    +

    searcher-package _PACKAGE

    +

    searcher: Query Search Interfaces

    +

    searcher()

    +

    Generate a Searcher function for use with Error Handling

    + + +
    + + +
    + + + + + + + + diff --git a/reference/search_site.html b/reference/search_site.html new file mode 100644 index 0000000..7498336 --- /dev/null +++ b/reference/search_site.html @@ -0,0 +1,349 @@ + +Search a Query on a Search Portal in a Web Browser — search_site • 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", "rseek",
    +    "rstudio community", "rscom", "twitter", "stackoverflow", "so", "github", "gh",
    +    "bitbucket", "bb"),
    +  rlang = TRUE
    +)
    +
    +search_google(query = geterrmessage(), rlang = TRUE)
    +
    +search_bing(query = geterrmessage(), rlang = TRUE)
    +
    +search_duckduckgo(query = geterrmessage(), rlang = TRUE)
    +
    +search_ddg(query = geterrmessage(), rlang = TRUE)
    +
    +search_ixquick(query = geterrmessage(), rlang = TRUE)
    +
    +search_startpage(query = geterrmessage(), rlang = TRUE)
    +
    +search_sp(query = geterrmessage(), rlang = TRUE)
    +
    +search_ecosia(query = geterrmessage(), rlang = TRUE)
    +
    +search_rseek(query = geterrmessage(), rlang = TRUE)
    +
    +search_rstudio_community(query = geterrmessage(), rlang = TRUE)
    +
    +search_rscom(query = geterrmessage(), rlang = TRUE)
    +
    +search_twitter(query = geterrmessage(), rlang = TRUE)
    +
    +search_stackoverflow(query = geterrmessage(), rlang = TRUE)
    +
    +search_so(query = geterrmessage(), rlang = TRUE)
    +
    +search_github(query = geterrmessage(), rlang = TRUE)
    +
    +search_gh(query = geterrmessage(), rlang = TRUE)
    +
    +search_bitbucket(query = geterrmessage(), rlang = TRUE)
    +
    +search_bb(query = geterrmessage(), rlang = TRUE)
    +
    + +
    +

    Arguments

    +
    query
    +

    Contents of string to search. Default is the error message.

    + + +
    site
    +

    Name of site to search on. Supported options: +"google" (default), "bing", "duckduckgo", "startpage", +"rstudio community", "twitter","stackoverflow", +"github", and "bitbucket".

    + + +
    rlang
    +

    Search for results written in R. Default is TRUE

    + +
    +
    +

    Value

    + + +

    The generated search URL or an empty string.

    +
    + + + + + + + + + + + +
    +

    See also

    +

    search_google(), search_bing(), search_duckduckgo(), +search_startpage(), search_rseek(), search_twitter(), +search_rstudio_community(), search_stackoverflow(), +search_github(), search_bitbucket(), and searcher()

    +
    + +
    +

    Examples

    +
    # Search in a generic way
    +search_site("r-project", "google")
    +#> Please type into your browser:
    +#> https://google.com/search?q=r-project%20r%20programming
    +
    +# Search Google
    +search_google("r-project")
    +#> Please type into your browser:
    +#> https://google.com/search?q=r-project%20r%20programming
    +
    +# Search Bing
    +search_bing("Microsoft R")
    +#> Please type into your browser:
    +#> https://bing.com/search?q=Microsoft%20R%20r%20programming
    +
    +# Search DuckDuckGo
    +search_duckduckgo("R language")
    +#> Please type into your browser:
    +#> https://duckduckgo.com/?q=R%20language%20r%20programming
    +
    +# Search startpage
    +search_startpage("VS Code")
    +#> Please type into your browser:
    +#> https://startpage.com/do/dsearch?query=VS%20Code%20r%20programming
    +
    +# Search Rseek
    +search_rseek("searcher")
    +#> Please type into your browser:
    +#> https://rseek.org/?q=searcher%20
    +
    +# Search RStudio Community
    +search_rstudio_community("RStudio IDE")
    +#> Please type into your browser:
    +#> https://community.rstudio.com/search?q=RStudio%20IDE
    +
    +# Search Twitter
    +search_twitter("searcher")
    +#> Please type into your browser:
    +#> https://twitter.com/search?q=searcher %23rstats
    +
    +# Search StackOverflow for Convolutions in the r tag
    +search_stackoverflow("convolutions")
    +#> Please type into your browser:
    +#> https://stackoverflow.com/search?q=convolutions%20[r]
    +
    +# Search all languages on StackOverflow for convolutions
    +search_stackoverflow("convolutions", rlang = FALSE)
    +#> Please type into your browser:
    +#> https://stackoverflow.com/search?q=convolutions
    +
    +# Search GitHub Issues for bivariate normal in the language:r
    +search_github("bivariate normal")
    +#> Please type into your browser:
    +#> https://github.com/search?q=bivariate%20normal%20language:r%20type:issue&type=Issues
    +
    +# Search all languages on GitHub Issues for bivariate normal
    +search_github("bivariate normal", rlang = FALSE)
    +#> Please type into your browser:
    +#> https://github.com/search?q=bivariate%20normal&type=Issues
    +
    +# Search BitBucket for assertions
    +search_bitbucket("assertions")
    +#> Please type into your browser:
    +#> https://bitbucket.com/search?q=assertions%20lang:r
    +
    +if (FALSE) {
    +# On error, automatically search the message on google
    +options(error = searcher("google"))
    +options(error = search_google)
    +}
    +
    +
    +
    + +
    + + +
    + + + + + + + + diff --git a/reference/searcher-defunct.html b/reference/searcher-defunct.html new file mode 100644 index 0000000..5b131a8 --- /dev/null +++ b/reference/searcher-defunct.html @@ -0,0 +1,96 @@ + +Defunct functions in searcher — searcher-defunct • searcher + + +
    +
    + + + +
    +
    + + +
    +

    Functions listed below are no longer included in the searcher package

    +
    + + +
    +

    Details

    + +
    + +
    + +
    + + +
    + + + + + + + + diff --git a/reference/searcher-package.html b/reference/searcher-package.html new file mode 100644 index 0000000..0c6f455 --- /dev/null +++ b/reference/searcher-package.html @@ -0,0 +1,116 @@ + +searcher: Query Search Interfaces — searcher-package • searcher + + +
    +
    + + + +
    +
    + + +
    +

    Provides a search interface to look up terms on 'Google', 'Bing', 'DuckDuckGo', 'Startpage', 'Ecosia', 'rseek', 'Twitter', 'StackOverflow', 'RStudio Community', 'GitHub', and 'BitBucket'. Upon searching, a browser window will open with the aforementioned search results.

    +
    + + +
    +

    Package Customizations

    + + + +

    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".

    • +
    • ...

    • +
    + +
    +

    Author

    +

    Maintainer: James Balamuta balamut2@illinois.edu (ORCID)

    +

    Other contributors:

    + +
    + +
    + + +
    + + + + + + + + diff --git a/reference/searcher.html b/reference/searcher.html new file mode 100644 index 0000000..d66329e --- /dev/null +++ b/reference/searcher.html @@ -0,0 +1,138 @@ + +Generate a Searcher function for use with Error Handling — searcher • 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"))
    +
    + +
    +

    Arguments

    +
    site
    +

    Name of site to search on. Supported options: +"google" (default), "bing", "duckduckgo", "startpage", +"rstudio community", "twitter","stackoverflow", +"github", and "bitbucket".

    + + +
    keyword
    +

    Opt to search under different default terms.

    + +
    +
    +

    Details

    +

    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.

    +
    + + +
    +

    Examples

    +
    ### Manually
    +searcher("google")()
    +#> Please type into your browser:
    +#> https://google.com/search?q=test.r:1:1:%20unexpected%20'%3C'%0A1:%20%3C%0A%20%20%20%20%5E%20r%20programming
    +
    +if (FALSE) {
    +### Automatically
    +# On error, automatically search the message on google
    +options(error = searcher("google"))
    +}
    +
    +
    +
    + +
    + + +
    + + + + + + + + diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..e0cddeb --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,36 @@ + + + + https://r-pkg.thecoatlessprofessor.com/searcher/404.html + + + https://r-pkg.thecoatlessprofessor.com/searcher/articles/index.html + + + https://r-pkg.thecoatlessprofessor.com/searcher/articles/search-patterns.html + + + https://r-pkg.thecoatlessprofessor.com/searcher/authors.html + + + https://r-pkg.thecoatlessprofessor.com/searcher/index.html + + + https://r-pkg.thecoatlessprofessor.com/searcher/news/index.html + + + https://r-pkg.thecoatlessprofessor.com/searcher/reference/index.html + + + https://r-pkg.thecoatlessprofessor.com/searcher/reference/search_site.html + + + https://r-pkg.thecoatlessprofessor.com/searcher/reference/searcher-defunct.html + + + https://r-pkg.thecoatlessprofessor.com/searcher/reference/searcher-package.html + + + https://r-pkg.thecoatlessprofessor.com/searcher/reference/searcher.html + +