Glue strings to data with glue

Glue strings to data with glue

String interpolation, evaluating a variable name to a value within a string, isa feature of many programming languages including Python, Julia, Javascript, Rust, and most Unix Shells. R's `sprintf()` and `paste()` functions provide some of this functionality, but have limitations which make them cumbersome to use. There are also some existing add on packages with similar functionality,however each has drawbacks.The glue package performs robust string interpolation for R. This includes evaluation of variables and arbitrary R code,with a clean and simple syntax. Because it is dependency-free, it is easy to incorporate into packages. In addition, glue provides an extensible interface to perform more complex transformations; such as `glue_sql()` to construct SQL queries with automatically quoted variables.This talk will show how to utilize glue to write beautiful code which is easy to read, write and maintain. We will also discuss ways to best use glue when performance is a concern. Finally we will create custom glue functions tailored towards specific use cases, such as JSON construction, colored messages, emoji interpolation and more.

6170c1d1970baf2a36a9ae2955e47ff3?s=128

Jim Hester

July 12, 2018
Tweet