https://github.com/sckott/resteasy
https://github.com/sckott/resteasy
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sckott/resteasy
- Owner: sckott
- License: other
- Created: 2015-04-06T17:13:40.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-04-06T18:39:53.000Z (over 11 years ago)
- Last Synced: 2026-01-11T11:32:44.520Z (6 months ago)
- Language: R
- Size: 129 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
resteasy
========
```{r echo=FALSE}
library("knitr")
hook_output <- knitr::knit_hooks$get("output")
knitr::knit_hooks$set(output = function(x, options) {
lines <- options$output.lines
if (is.null(lines)) {
return(hook_output(x, options)) # pass to default hook
}
x <- unlist(strsplit(x, "\n"))
more <- "..."
if (length(lines) == 1) { # first n lines
if (length(x) > lines) {
# truncate the output, but add ....
x <- c(head(x, lines), more)
}
} else {
x <- c(if (abs(lines[1]) > 1) more else NULL,
x[lines],
if (length(x) > lines[abs(length(lines))]) more else NULL
)
}
# paste these lines together
x <- paste(c(x, ""), collapse = "\n")
hook_output(x, options)
})
knitr::opts_chunk$set(
comment = "#>",
collapse = TRUE,
warning = FALSE,
message = FALSE
)
```
## Installation
```{r eval=FALSE}
install.packages("devtools")
devtools::install_github("sckott/resteasy")
```
```{r}
library("resteasy")
```
## GET a README file
```{r}
easy_readme("sckott/testeasy")
```
## GET a csv file as a data.frame
Get the whole file
```{r}
easy_get("ropensci/datasets", "mammals/mammals.csv")
```
Filter by a column, `Family = "Coryphodontidae"`
```{r}
easy_get("ropensci/datasets", "mammals/mammals.csv", Family = "Coryphodontidae")
```
Filter by a column, `Last_appearance_mya = 50`
```{r}
easy_get("ropensci/datasets", "mammals/mammals.csv", Last_appearance_mya = 50)
```
## Create a file
```{r output.lines = 1:10}
options(github_name = "Scott Chamberlain")
options(github_email = "myrmecocystus@gmail.com")
easy_create(iris, repo = "sckott/testeasy", path = "iris.csv", message = "hello world")
```
## Update a file
...
## Delete a file
...