rawr (version 0.1.0)

rawr: Automatically identify website and retrieve raw R code from it

Description

Automatically identify website and retrieve raw R code from it

Usage

rawr(url)

Arguments

url

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

Value

A character vector of length 1. rawr attempts to retrieve and return the raw R code it finds at the target url. In the case of blogdown pages, all code will be returned (not just) R code, and in the case of kaggle, all of R (R markdown) and Python code will be returned.

Examples

Run this code
# NOT RUN {
library(dplyr)
rawr("https://github.com/hadley/vis-eda/blob/master/travel.R")

# Same as above but provided to cat for easy viewing
rawr("https://github.com/hadley/vis-eda/blob/master/travel.R") %>%
  cat


# Use on multiple urls

domains <- c("https://github.com/hadley/vis-eda/blob/master/travel.R",
"https://www.datacamp.com/community/tutorials/sentiment-analysis-R",
"https://www.tidytextmining.com/sentiment.html",
"https://www.kaggle.com/vrtjso/mercari-eda-more-info-than-you-can-imagine",
"https://www.jtimm.net/2019/04/14/lexical-change-procrustes/")

domains %>% sapply(rawr)
# }

Run the code above in your browser using DataLab