Skip to content

Collapse not working as expected in toJSON #20

@apapanico

Description

@apapanico

When I give toJSON a list of lists and an empty collapse string, the function seems to fail to collapse the JSON string properly. Below is a minimal example.

library(RJSONIO)
x1 <- list(a=1,b=2)
x2 <- list(c=3,d=4)
x3 <- list(x1,x2)
toJSON(x1,collapse="")
toJSON(x2,collapse="")
toJSON(x3,collapse="")
[1] "{ \"a\": 1,\"b\": 2 }"
[1] "{ \"c\": 3,\"d\": 4 }"
[1] "[ {\n \"a\": 1,\n\"b\": 2 \n},{\n \"c\": 3,\n\"d\": 4 \n} ]"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions