Repository navigation
-
Added
radix_id()andradix_group():radix_id()encodes row combinations as a mixed-radix numeric code (equal rows share a code, faster thanpaste());radix_group()returns a 1-based group index in first-appearance order. -
Added
rustto the internal objectcomment_chars(thanks, @kbvernon, #132). -
taml_load()now parses flow arrays ([...]) correctly when elements are surrounded by spaces (e.g.[ 1, 2 ]), and keeps quoted values as strings even when they look numeric (e.g.["1"]is"1", not1) (thanks, @reedacartwright, #133). -
taml_load()now understands single-quoted scalars (''is a literal') and the full set of YAML double-quote escape sequences (e.g.\t,\/,\e,\xNN,\uNNNN), and commas inside quoted flow-array elements are no longer treated as separators (thanks, @reedacartwright, #135). -
tojson()is faster now: string escaping is skipped when no special characters are present, theInf/-Infconversion is skipped when no infinite values are present, and matrices are serialized without a per-row function call. -
tojson()now emits each row of a single-column matrix as an array (e.g.,[[1], [2], [3]]) for consistency with multi-column matrices, instead of collapsing the rows into scalars. -
tojson()now escapes</scriptto<\/scriptin strings so the output can be safely embedded in an inline<script>block (a literal</script>would otherwise close the block early). This is still valid JSON and parses back to the original string. -
tojson()gained an argumentdictto dictionary-encode atomic vectors (and data-frame columns) with repeated values. When enabled, a vector is emitted as a runnable JavaScript expression[codes].map(i => [u][i])(0-basedcodesindexing the unique valuesu), so repeated values are serialized once instead of per element.dictis a numeric cardinality threshold in(0, 1](0, the default, disables it), and encoding is used only when it actually shortens the output, so near-unique vectors are left as plain arrays. -
tojson()gained an argumentpretty(TRUEby default). Withpretty = FALSE, the output is compact (single line, no indentation, and,instead of,between array elements), which can be substantially smaller for large data. -
tojson()now emits a nestedjsonvalue (e.g., a value pre-serialized bytojson()) raw instead of re-quoting it as a string, sotojson()output can be composed inside a largertojson()call. -
tojson()gained an argumentpack(and the optionxfun.tojson.pack) to pack long integer vectors (and thecodesofdict-encoded vectors) as base64 little-endian bytes in a small tagged object, which is smaller and much faster to parse than a number array; the new stringsjson_unpack(decode one packed object on demand, preferred for large data) andjson_reviver(forJSON.parse(), which is slower on large data) contain JavaScript code that turns the packed values into typed arrays. -
tojson()gained an argumentmode(and the optionxfun.tojson.mode), a master switch over every construct that is not strict JSON. With the defaultmode = "js", dates becomenew Date(...),Inf/-InfbecomeInfinity/-Infinity, anddict/pack-encoded vectors become self-contained JavaScript expressions (anunpack(...)call, wrapped in an IIFE that definesunpack()). Withmode = "json", the whole output is standard JSON thatJSON.parse()accepts: dates become plain quoted strings,Inf/-Infbecomenull(asJSON.stringify()does), anddict/pack-encoded vectors become tagged objects thatjson_reviverexpands back. This replaces themodefield previously read from thepackargument. -
browser_print()andbrowser_dom()now run the headless browser with its temporary directory pointed at a private subdirectory that is deleted afterward, so the browser's scratch files (e.g.com.google.Chrome.*) no longer accumulate in the session's temp directory (which also trippedR CMD check's detritus NOTE for packages using these functions). -
submit_cran()(and the automatic tarball build behind it) now runs optional build hooks: scripts namedtools/build-before.*andtools/build-after.*in the package are run before and afterR CMD build(.RviaRscript,.shviash). Abuild-beforescript can generate files that ship in the tarball but are not kept in the source tree (e.g. download or minify assets), and thebuild-afterscript (run even if the build fails) can restore the source tree.