rawr (version 0.1.3)

blogdown: Retrieve raw R code from a blogdown web page

Description

Retrieve raw R code from a blogdown web page

Usage

blogdown(url, method, padding)

Arguments

url

Link to a blogdown web page

method

Not all websites are formatted consistently. To overcome this, try a different method by setting the 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

A character vector of length 1 containing the R code from the target url. Code from other languages (e.g. javascript, bash, or python) will also be returned if present.

Examples

Run this code
# NOT RUN {
library(dplyr)
blogdown("https://www.jtimm.net/2019/04/14/lexical-change-procrustes/")

# Same as above but provided to cat for easy viewing
blogdown("https://www.jtimm.net/2019/04/14/lexical-change-procrustes/")  %>%
  cat
# }

Run the code above in your browser using DataLab