Skip to content

unbox R lists for output.json for them because df like objects don't unbox easily in json #153

@madeline-scyphers

Description

@madeline-scyphers

df like objects (tibbles, etc) when doing calculations on them and jsonifying will wrap in a list unless you unbox, but you have to know that. So BOA should do that for them if it is a 1 element list.

example R code:

> library(tibble)
> library(jsonlite)

> df <- tibble('x' = runif(16, 0, 5), 'y' = runif(16, 100, 500))
> res <- df %>% select(y,x) %>% summarise('Y'=sum(y), 'X'=sum(x))
> res
[{"Y":5442.2436,"X":37.2998}]

Because this is a 1 element list with the correct dictionary insidie it, BOA should just do output = ls[0] to make everyones lives easier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions