RcppTOML v0.1.5


Monthly downloads



'Rcpp' Bindings to Parser for Tom's Obvious Markup Language

The configuration format defined by 'TOML' (which expands to "Tom's Obvious Markup Language") specifies an excellent format (described at <https://github.com/toml-lang/toml>) suitable for both human editing as well as the common uses of a machine-readable format. This package uses 'Rcpp' to connect the 'cpptoml' parser written by Chase Geigle (in modern C++11) to R.


RcppTOML Build Status License CRAN Dependencies Downloads

Rcpp bindings for TOML

What is TOML?

TOML is a configuration file grammar for humans. It is easier to read and edit than the alternatives yet arguably more useful as it is strongly typed: values come back as integer, double, (multiline-) character (strings), boolean or Datetime. Moreover, complex nesting and arrays are supported as well.

This package uses the C++11 implementation written by Chase Geigle in cpptoml to provide a parser that can be used by R.


Consider the following TOML input example input:

# This is a TOML document.

title = "TOML Example"

name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00 # First class dates

server = ""
ports = [ 8001, 8001, 8002 ]
connection_max = 5000
enabled = true


  # Indentation (tabs and/or spaces) is allowed but not required
  ip = ""
  dc = "eqdc10"

  ip = ""
  dc = "eqdc10"

data = [ ["gamma", "delta"], [1, 2] ]

# Line breaks are OK when inside arrays
hosts = [

Once parsed, note how R has properly typed input:

R> library(RcppTOML)
R> parseTOML("inst/toml/example.toml")
List of 5
 $ clients :List of 2
  ..$ data :List of 2
  .. ..$ : chr [1:2] "gamma" "delta"
  .. ..$ : int [1:2] 1 2
  ..$ hosts: chr [1:2] "alpha" "omega"
 $ database:List of 4
  ..$ connection_max: int 5000
  ..$ enabled       : logi TRUE
  ..$ ports         : int [1:3] 8001 8001 8002
  ..$ server        : chr ""
 $ owner   :List of 2
  ..$ dob : POSIXct[1:1], format: "1979-05-27 15:32:00"
  ..$ name: chr "Tom Preston-Werner"
 $ servers :List of 2
  ..$ alpha:List of 2
  .. ..$ dc: chr "eqdc10"
  .. ..$ ip: chr ""
  ..$ beta :List of 2
  .. ..$ dc: chr "eqdc10"
  .. ..$ ip: chr ""
 $ title   : chr "TOML Example"

See the other examples and the upstream documentation for more. Also note that most decent editors have proper TOML support which makes editing and previewing a breeze:


The package is on CRAN and can be installed from every mirror via


Development releases may be provided by the ghrr repository which can accessed via

## if needed, first do:  install.packages("drat")


Feature-complete with TOML v0.4.0, see the tests/ directory. It parses everything that the underlying cpptoml parses with the same (sole) exception of unicode escape characters in strings.


Dirk Eddelbuettel


GPL (>= 2)

Functions in RcppTOML

Name Description
parseTOML Parse a TOML configuration file
RcppTOML-package R Access to Parser for TOML (Tom's Obvious Markup Language)
No Results!

Last month downloads


Type Package
Date 2018-10-31
SystemRequirements A C++11 compiler; g++ (>= 4.8.*) should be fine.
BugReports https://github.com/eddelbuettel/rcpptoml/issues
URL http://dirk.eddelbuettel.com/code/rcpp.toml.html
LinkingTo Rcpp
License GPL (>= 2)
NeedsCompilation yes
Packaged 2018-10-31 12:00:02.477047 UTC; edd
Repository CRAN
Date/Publication 2018-10-31 12:30:03 UTC

Include our badge in your README