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 )
install.packages("devtools") devtools::install_github("sckott/resteasy")
library("resteasy")
easy_readme("sckott/testeasy")
Get the whole file
easy_get("ropensci/datasets", "mammals/mammals.csv")
Filter by a column, Family = "Coryphodontidae"
easy_get("ropensci/datasets", "mammals/mammals.csv", Family = "Coryphodontidae")
Filter by a column, Last_appearance_mya = 50
easy_get("ropensci/datasets", "mammals/mammals.csv", Last_appearance_mya = 50)
options(github_name = "Scott Chamberlain") options(github_email = "myrmecocystus@gmail.com") easy_create(iris, repo = "sckott/testeasy", path = "iris.csv", message = "hello world")
...
...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.