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

Workaround to load/retrieve high dimentional data files to be used by app #69

Open
rekren opened this issue Mar 28, 2024 · 2 comments
Open

Comments

@rekren
Copy link

rekren commented Mar 28, 2024

Hi there,

Many thanks to come up with shiny implementation for static html pages!
I have an issue to find a workaround for webr, to work with data formats other than csv file.

Converting a high dimentional data into csv is super inefficient and, I am intrigued that what other approaches may work considering the architecture of WebR?

I have read about local folder support (#13), and RDS loading problem (#65).

Is there a way to make an app run with a data in e.g. HDF5 file format ?

Thank you for your time and efforts !

@seanbirchall
Copy link

@rekren hosting the data remotely could work. Assuming you're currently trying to compile this data statically with your app that won't work. I have noticed that csv's do work but internally you can actually inspect what's happening and the app will create a comma separated string within app.json (unlikely many additional files will be supported doing this, nor should they). Remotely storing the file on any blob storage that can be accessed via http should do, you can then fetch the file using download.file. Somewhat similar to mounting a folder which will probably also work already and be the recommended way of doing this (https://docs.r-wasm.org/webr/latest/mounting.html).

@georgestagg
Copy link
Collaborator

georgestagg commented May 21, 2024

The data loading problem in #65 should now be fixed. As Sean mentions, the {shinylive} R package should now be able to export() binary data files, including RDS and other formats.

Here is an example of a Shinylive app (in this case with binary data distributed via GitHub gist) that loads various types of data files into memory:

https://shinylive.io/r/editor/#gist=0af60c8b3a63f1c9e253838fdb8957a7

[Source]


I'm unaware of a way to load HDF5 files into webR right now, but eventually I expect we'll include the netcdf and hdf5 open-source engines as part of webR's WebAssembly libraries. Once that work has been done, the R packages for reading hdf5 files should be loadable in webR and Shinylive.

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

No branches or pull requests

3 participants