In fromJSON(), when nullValue is NA (the logical NA) we attempt to simplify vectors with JSON null values.
Added simplifyWithNames to fromJSON() for controlling whether we attempt to collapse collections of values read from JSON if they have names. This can be used to collapse unnamed vectors, but leave named lists that would otherwise be collapsed to vectors.
Added support in fromJSON() for collapsing particular types of elements, i.e. logicals, numbers or characters via StrictLogical, StrictNumeric and StrictCharacter. This allows "strict" collapsing, but for different types, while leaving others as lists. These can be combined.
Added to the ability to control whether we simplify the content using simplify = Strict or TRUE or FALSE.
Added .escapeEscapes to toJSON() to allow the caller to preserve new lines and tabs symbolically or not. Thanks to Antonio Piccolboni for the report about the issue.
Added .na parameter to the toJSON() function and methods so that the caller can control how NA values are mapped to JSON. This defaults to "null" so that the resulting JSON is well-formed. However, users should explicitly think about how NA values (and Inf and NaN) are mapped to JSON in order to avoid ambiguity and faithfully serialize their data in a meaningful manner.
Added a nullValue parameter to fromJSON() to allow the caller to provide an R object that will be used when we encounter a JSON null value. This can be used for example to map null to NA in R.
Added more support for simplifying lists to vectors of different types. In the future, I might add a simplify = "strict" mode that would only collapse vectors if all the elements were of the same type, not just compatible types. In other words, [true, 1 ] would not collapse to c(1, 1) in R.
I will rewrite my R driver 4 couchdb (R4CouchDB) asap!
since the NA problem sems to be solved now, R4CouchDB can make a big step …