Skip to content

Bug in toJSON with lists containing vectors of length zero #13

Description

@kevinushey

@yihui and I are seeing the following behavior:

> cat( toJSON( list(x=1, y=character(0)) ) )
{
 "x":      1,
"y":      1 
}

This is because unlist is used to collect results, but because the y element is empty, it is dropped and then the element 1 is recycled.

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