Websites containing R code sometimes necessitate tedious copy/pasting of code blocks from the website to your code editor in order for you to be able to run the code for yourself.
rawr
takes care of this.
To get the code from a kaggle notebook:
library(rawr)
code <- rawr("https://www.kaggle.com/vrtjso/mercari-eda-more-info-than-you-can-imagine")
# View code easily
cat(code)
Here's a great tutorial.
What if you want to run the R code yourself? Easy!
library(rawr)
code <- rawr("https://www.tidytextmining.com/sentiment.html")
The output is a little hard to read though! That's easily solved
code %>% cat
rawr
currently supports github, kaggle, datacamp, and many blogdown sites. Try it
library(rawr)
library(dplyr)
rawr("https://www.datacamp.com/community/tutorials/sentiment-analysis-R") %>% cat
rawr("https://github.com/hadley/vis-eda/blob/master/travel.R") %>% cat
rawr("https://www.kaggle.com/vrtjso/mercari-eda-more-info-than-you-can-imagine") %>% cat
rawr("https://www.jtimm.net/2019/04/14/lexical-change-procrustes/") %>% cat
See:
?rawr::rawr
?rawr::datacamp
?rawr::github
?rawr::kaggle
?rawr::tidytext
When reporting an issue, please include:
- Example code that reproduces the observed behavior.
- An explanation of what the expected behavior is.
- A specific url you're attempting to retrieve R code from (if that's what your issue concerns)
For feature requests, raise an issue with the following:
- The desired functionality
- Example inputs and desired output
Pull requests are welcomed.
Any new functions should follow the conventions established by the the package's existing functions. Please ensure
- Functions are sensibly named
- The intent of the contribution is clear
- At least one example is provided in the documentation