Skip to content

Commit

Permalink
moved to importfrom to only import used fxns
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Apr 8, 2015
1 parent 5b9da1b commit 854c598
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
16 changes: 12 additions & 4 deletions NAMESPACE
Expand Up @@ -36,16 +36,24 @@ export(tabl)
export(unstar)
export(update)
export(update_files)
import(assertthat)
import(httr)
import(knitr)
import(rmarkdown)
importFrom(assertthat,assert_that)
importFrom(dplyr,as_data_frame)
importFrom(dplyr,rbind_all)
importFrom(git2r,add)
importFrom(git2r,commit)
importFrom(git2r,init)
importFrom(git2r,push)
importFrom(git2r,remote_add)
importFrom(httr,DELETE)
importFrom(httr,GET)
importFrom(httr,PATCH)
importFrom(httr,POST)
importFrom(httr,PUT)
importFrom(httr,add_headers)
importFrom(httr,content)
importFrom(httr,stop_for_status)
importFrom(httr,warn_for_status)
importFrom(jsonlite,flatten)
importFrom(knitr,knit)
importFrom(magrittr,"%>%")
importFrom(rmarkdown,render)
3 changes: 2 additions & 1 deletion R/gist.R
@@ -1,6 +1,7 @@
#' Get a gist
#'
#' @import httr
#' @importFrom httr GET POST PATCH PUT DELETE content stop_for_status
#' add_headers warn_for_status
#' @export
#' @param id (character) A gist id
#' @param x Object to coerce. Can be an integer (gist id), string
Expand Down
3 changes: 2 additions & 1 deletion R/gist_create.R
@@ -1,7 +1,8 @@
#' Create a gist
#'
#' @export
#' @import knitr rmarkdown
#' @importFrom knitr knit
#' @importFrom rmarkdown render
#' @template args
#' @examples \dontrun{
#' gist_create(files="~/stuff.md", description='a new cool gist')
Expand Down
8 changes: 4 additions & 4 deletions R/gist_map.R
Expand Up @@ -6,17 +6,17 @@
#' @param gist_object An object of class \code{gist_id} generated by \code{gist_create}
#' @param browse Default is \code{TRUE}. Set to \code{FALSE} if you don't want to automatically browse to the URL.
#' @export
#' @import assertthat
#' @importFrom assertthat assert_that
#' @examples \dontrun{
#' library(ecoengine)
#' x <- ee_observations(genus = "vulpes")
#' ee_map(x, dest = "~/Desktop")
#' gist_id <- gist_create(files = "~/Desktop/temp.geojson", browse = FALSE)
#' gist_map(gist_id)
#'
#'
#'}
gist_map <- function(gist_object, browse = TRUE) {

file <- names(gist_object$files)
assertthat::assert_that(has_extension(file, "geojson"))
render_url <- "https://render.githubusercontent.com/view/geojson/?url=https://gist.githubusercontent.com/"
Expand All @@ -32,4 +32,4 @@ gist_map <- function(gist_object, browse = TRUE) {
} else {
path
}
}
}

0 comments on commit 854c598

Please sign in to comment.