diff --git a/NAMESPACE b/NAMESPACE index 445c84d..8b2452b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -12,6 +12,8 @@ export(dcrchart) export(geojson) export(html) export(js) +export(pluck_key) +export(pluck_value) export(reduceCount) export(reduceMean) export(reduceSum) diff --git a/R/utils.R b/R/utils.R index 06c0755..3e1d40d 100644 --- a/R/utils.R +++ b/R/utils.R @@ -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) diff --git a/man/pluck_key.Rd b/man/pluck_key.Rd new file mode 100644 index 0000000..3f49453 --- /dev/null +++ b/man/pluck_key.Rd @@ -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 +} + diff --git a/man/pluck_value.Rd b/man/pluck_value.Rd new file mode 100644 index 0000000..791f558 --- /dev/null +++ b/man/pluck_value.Rd @@ -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 +} +