Skip to content

Commit

Permalink
pluck functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangdong Gu authored and Xiangdong Gu committed Jul 28, 2015
1 parent 87a29eb commit 9244f72
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export(dcrchart)
export(geojson)
export(html)
export(js)
export(pluck_key)
export(pluck_value)
export(reduceCount)
export(reduceMean)
export(reduceSum)
Expand Down
12 changes: 12 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,15 @@ y_axis <- function(...) {
##' @param id chart id
##' @export
chartname <- function(id) dc_code(sprintf("chart%s", id))

##' Get a variable in the key
##' @param var variable
##' @export
##'
pluck_key <- function(var) simple_fun(sprintf("d.key.%s"), var)

##' Get a variable in the value
##' @param var variable
##' @export
##'
pluck_value <- function(var) simple_fun(sprintf("d.value.%s"), var)
15 changes: 15 additions & 0 deletions man/pluck_key.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/utils.R
\name{pluck_key}
\alias{pluck_key}
\title{Get a variable in the key}
\usage{
pluck_key(var)
}
\arguments{
\item{var}{variable}
}
\description{
Get a variable in the key
}

15 changes: 15 additions & 0 deletions man/pluck_value.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/utils.R
\name{pluck_value}
\alias{pluck_value}
\title{Get a variable in the value}
\usage{
pluck_value(var)
}
\arguments{
\item{var}{variable}
}
\description{
Get a variable in the value
}

0 comments on commit 9244f72

Please sign in to comment.