Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return scaleSet$scales as a data.frame #69

Open
gegnew opened this issue Aug 15, 2021 · 2 comments
Open

return scaleSet$scales as a data.frame #69

gegnew opened this issue Aug 15, 2021 · 2 comments
Milestone

Comments

@gegnew
Copy link
Contributor

gegnew commented Aug 15, 2021

It's annoying to have scaleSet$scales return a single-length nested list (see below); it would be better to return as a dataframe. This is a breaking change.

> scaleSet$scales
[[1]] # <- this is a pain
    channelName   scale.type scale.minimum scale.maximum scale.cofactor
1         FSC-A     LogScale             1        100000             NA
2         FSC-W  LinearScale             1        262144             NA
3         SSC-A ArcSinhScale          -200        262144            150
4       Ax488-A ArcSinhScale          -200        262144            150
@gegnew
Copy link
Contributor Author

gegnew commented Sep 22, 2021

An initial investigation reveals that this may not be possible in any sort of consistent fashion.

This works:

x = jsonlite::fromJSON(content)
y = list()
y$scales = x$scales[[1]]

but none of these do:

x = jsonlite::fromJSON(content)
x$scales = x$scales[[1]]
x$foo = x$xcales[[1]]

z = x$scales[[1]]
x$scales <- NULL
x$scales <- z

x$foo <- z

relevant discussion: rstudio/plumber#69

@gegnew
Copy link
Contributor Author

gegnew commented Sep 22, 2021

I personally find it incredibly annoying to have to to x$scales[[1]] every time I want to access the scales, but maybe happy R users don't feel so strongly about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant