https://github.com/fschaffner/websearchr
Access Domains and Search Popular Websites in R
https://github.com/fschaffner/websearchr
cran internet r search search-engine web
Last synced: 3 months ago
JSON representation
Access Domains and Search Popular Websites in R
- Host: GitHub
- URL: https://github.com/fschaffner/websearchr
- Owner: fschaffner
- License: other
- Created: 2017-08-31T15:00:29.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-09-27T16:26:04.000Z (over 6 years ago)
- Last Synced: 2025-12-09T21:49:42.548Z (7 months ago)
- Topics: cran, internet, r, search, search-engine, web
- Language: R
- Homepage: https://florianschaffner.com/websearchr
- Size: 193 KB
- Stars: 11
- Watchers: 0
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
[](https://cran.r-project.org/package=websearchr)

[](https://travis-ci.org/fschaffner/websearchr)
[](https://www.tidyverse.org/lifecycle/#stable)
## Overview
The purpose of **websearchr** is to provide a convenient way of accessing domains and searching popular websites directly from the R console. When working on small screens in particular, switching from the R console to the browser window, opening a new tab, navigating to the desired website and finally searching for the search terms requires around 3-6 clicks. As one is working mainly in the R console, it is more convenient to start typing the search terms right away, without having to go through the process mentioned above. For example, `stackoverflow("my r problem")` will open the Stackoverflow search for "my r problem" in a new browser tab automatically.
Currently supported websites:
* Bing
* Crossref
* Duckduckgo
* GitHub
* Google
* Google Scholar
* Qwant
* r-bloggers.com
* Rdocumentation.org
* rdrr.io
* Reddit
* Stackoverflow
* Startpage
* Twitter
* Wikipedia
* Wolfram Alpha
Any other domain can be accessed with `web("example.com")`. You can also simply open the search engine in the browser by not specifying a search term, e.g. using `duckduckgo()`.
#### Search last error or warning
You can easily search for the last produced error or warning using `last_error()` or `last_warning()` inside one of the search functions, e.g. `startpage(last_error())`.
#### Language support
Twitter and Wikipedia can be searched in different languages than English. For example, to search the French version of Wikipedia use `wikipedia("Langage de programmation", "fr")`.
#### Browser
To use a browser other than the default on your computer use `options(browser = "path to browser")`. For example, on macOS `options(browser = "/usr/bin/open -a '/Applications/Safari.app'")` or Windows `options(browser = "C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe")`. To check which browser is set as the default use `getOption("browser")`.
## Installation
You can install websearchr from CRAN with:
```{r cran-installation, eval = FALSE}
install.packages("websearchr")
```
Or install the development version from GitHub:
```{r gh-installation, eval = FALSE}
remotes::install_github("fschaffner/websearchr")
```
Please report issues or requests for additional functionality to https://github.com/fschaffner/websearchr/issues.
## Example
```{r example}
library("websearchr")
# Try:
web("r-project.org")
google("my search terms")
stackoverflow("my r problem")
```
## The Meme

