Usage
fromJSON(txt, simplifyVector = TRUE,
simplifyDataFrame = simplifyVector,
simplifyMatrix = simplifyVector, ...) toJSON(x, dataframe = c("rows", "columns"),
matrix = c("rowmajor", "columnmajor"),
Date = c("ISO8601", "epoch"),
POSIXt = c("string", "ISO8601", "epoch", "mongo"),
factor = c("string", "integer"),
complex = c("string", "list"),
raw = c("base64", "hex", "mongo"),
na = c("null", "string"), digits = 2, pretty = FALSE,
...)
Arguments
x
the object to be encoded
dataframe
how to encode data.frame objects: must
be one of 'row' or 'column'
matrix
should matrices and higher dimensional
arrays be encoded in row-major or column-major.
Date
how to encode Date objects: must be one of
'ISO8601' or 'epoch'
POSIXt
how to encode POSIXt (datetime) objects:
must be one of 'string', 'ISO8601', 'epoch' or 'mongo'
factor
how to encode factor objects: must be one
of 'string' or 'integer'
complex
how to encode complex numbers: must be one
of 'string' or 'list'
raw
how to encode raw objects: must be one of
'base64', 'hex' or 'mongo'
digits
max number of digits (after the dot) to
print for numeric values
na
how to print NA values. One of 'null' or
'string'. Defaults are class specific
pretty
adds indentation whitespace to JSON output.
See prettify
txt
a string in json format
simplifyVector
coerse JSON arrays containing only
scalars into a vector
simplifyDataFrame
coerse JSON arrays containing
only records (JSON objects) into a data frame.
simplifyMatrix
coerse JSON arrays containing
vectors of equal length and mode into matrix or array.
...
arguments passed on to class specific
print
methods