An open API service indexing awesome lists of open source software.

https://github.com/aephidayatuloh/rpubs

Package for extract code from RPubs article
https://github.com/aephidayatuloh/rpubs

Last synced: 3 months ago
JSON representation

Package for extract code from RPubs article

Awesome Lists containing this project

README

        

# rpubs : Extract code from RPubs article
[![Travis build status](https://travis-ci.org/aephidayatuloh/rpubs.svg?branch=master)](https://travis-ci.org/aephidayatuloh/rpubs)

[RPubs.com](https://rpubs.com) is a web publishing service for R articles created from R Markdown. When you find some interesting article, may be you want to copy the script to try reproduce on your local machine. The `rpubs` package can help you to automatically copy and paste the script (or with the output) without you have to do it manually.

## Install

```
# install.packages("devtools")
devtools::install_github("aephidayatuloh/rpubs")
```

## Usage

```
library(rpubs)
article <- "https://rpubs.com/aephidayatuloh/sendgmail"
rpubs_code(url = article, path = "myfolder/sendgmail.R", output = FALSE)
```

If you run the code above, after the process finished you will have the script file named `sendgmail.R` in `myfolder` folder. But, if the script in the article in a output-block part (this usually in a box with white background, different writing style from writer) then use `output = TRUE` to make the output-block part of script output file.