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

Converting R data.frame objects to/from JavaScript objects #364

Merged
merged 12 commits into from
Feb 27, 2024

Conversation

georgestagg
Copy link
Member

@georgestagg georgestagg commented Feb 22, 2024

Based on #363.

  • Constructing new R objects now supports input objects of the form: {a: [...], b: [...]} or D3-style data arrays of the form: [{a: ..., b: ...}, {a: ..., b: ...}, {a: ..., b: ...}, ... ]

  • Where possible (columns are all atomic vectors, all of equal length, and of consistent types), lists are constructed with class data.frame when constructed using await new RObject().

  • Direct construction with RList() does not create a data.frame.

  • R data.frame objects may be converted into D3-style data arrays using the new R list object method .toD3().

  • Update docs to give more information about conversion of R and JavaScript objects.

Fixes #303.

Base automatically changed from uint8array-input to main February 27, 2024 14:37
@georgestagg georgestagg merged commit bb317be into main Feb 27, 2024
3 checks passed
@georgestagg georgestagg deleted the d3-data-frame branch February 27, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error passing large array from JS to WebR
1 participant