rawr_to_clip: Retrieve raw R code from any github, kaggle, stack overflow,...

Description Usage Arguments Value Examples

View source: R/rawr_to_clip.R

Description

Retrieve raw R code from any github, kaggle, stack overflow, blogdown, or data camp web page

Usage

1
rawr_to_clip(url, method, padding)

Arguments

url

Link to an R file on supported website (github, kaggle, datacamp, tidytext)

method

Not all websites are formatted consistently. To overcome this, rawr may have more than one method for any site. If what rawr returns is not sensible, try setting method parameter to integers 2 and greater to try other available methods

padding

Specify what goes between the last character of one code block and the first character of the next code block. Default is a two new lines, which appears visually as one new line between code blocks.

Value

The raw R code from the URL provided written to the system clipboard (and so can be pasted in the usual way with ctrl + v / cmd + v). No object is returned to the R interpreter.

Examples

1
2
3
4
5
library(dplyr)
rawr_to_clip("https://cran.r-project.org/web/packages/tidytext/vignettes/tidytext.html")

# Also works with the magrittr pipe
"https://github.com/hadley/vis-eda/blob/master/travel.R" %>% rawr_to_clip

rawr documentation built on May 17, 2021, 5:07 p.m.

Related to rawr_to_clip in rawr...